here is my origin code:
$returnArray=array(
'loginUrl'=>$url."/?page_id=2732",
'clientNumber'=>$clientNumber,
'clientName'=>$_SESSION['userName']
);
echo json_encode($returnArray);
and here is my receiving end code:
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = trim(curl_exec($ch));
curl_close($ch);
$result = json_decode($result,true);
And finally here is the $result var_dump
string(194) "
{"loginUrl":"http:\/\/www.xxxxxxxxxxxx.co.il\/chtsystem\/?page_id=2732","clientNumber":"11111","clientName":"\u05d0\u05d1\u05d9 \u05d4\u05de\u05d3\u05d1\u05d9\u05e8 - www.yyy-yyyyyyy.co.il"}"
$result comes out null from the decode, when printing json errors I can see "JSON_ERROR_SYNTAX" is on
what is wrong here?
json_decode? I don't think it should.