I'm using both PHP and Javascript to build some kind of web service. I try to validate a token calculated on post parameters, sent from JS to PHP. Let's say the code is as follows:
JS :
token = JSON.stringify(params);
PHP :
token = json_encode($_POST);
Can somebody please explain me why the two resulting JSON strings doesn't have the same length ?
(I tried to trim \n\r\t
in PHP, stripslashes in PHP, several JS libs) The PHP version of the string always have some more characters.