I’m having issue working with json_decode() in PHP. Im using the json2.js library to convert a JSON to string. Then post it to PHP. That part seems fine.
Here is my PHP function :
public function SaveUser($json){
$json2 = json_decode($json,true);
print 'Intrant : <br />'.$json.'<br />';
print '<pre>VAR DUMP:<br />';
var_dump($json2);
print '</pre>';
// Do some things
}
The following returns the following :
Intrant :
{"user_id":"14","prenom":"prenom","nom":"nom","profil_heures_fixe":"0","nb_heures_fixe":"","is_userliste":"1","is_paye":"1","username":"username","password":"","telephone":"111-111-1111","cellulaire":"111-111-1111","extension":"30","courriel":"user@server.com","date_embauche":"2017-07-02","machine":"","profil_id":"4","status_id":"1","coordonnees":"","urgence":""}
VAR DUMP:
NULL
Thanks Marc B,
Since our server is using the charset ISO-8859-1 the json_decode function does not work.
Thanks all