I have a string which looks like this:
id_company=57&name=&address=&zip=&place=&phone=&mobile=&email=&birthdate=&birthplace=&bsn=&driver_expires=&role=&date_started=&contract=Tijdelijk&id_type=Paspoort&id_number=&id_expires=
Above example is empty for the most part (except id_company).
I serialize my form in jquery like this:
var $serialized = $form.serialize();
And in my php I do this:
$jsonemployee = unserialize($_POST['serialized']);
After that I try to print it because I expect an array:
echo '<pre>';
print_r($jsonemployee);
echo '</pre>';
But this shows me nothing.
I am 100% sure all data is passed, in my networktab I see the string being posted and if I just echo the string, it shows the string.
How can I create a PHP array from that string?
var_dump($_POST['serialized']). If you don't see anything then that data was never sent to the server.string(185) "id_company=57&name=&address=&zip=&place=&phone=&mobile=&email=&birthdate=&birthplace=&bsn=&driver_expires=&role=&date_started=&contract=Tijdelijk&id_type=Paspoort&id_number=&id_expires="