- var_dump: documentation ( source)
- json_encode: documentation ( source)
<?php
class call{
public function objectiveCall($month,$year,$state){
return [["field" => "mes", "value" => $month, "oper" => "equals"],
["field" => "anho", "value" => $year, "oper" => "equals"],
["field" => "state", "value" => $state, "oper" => "equals"]];
}
}
var_dump(json_encode(new call())->objectiveCall(2,3,4));