I have an php made array:
<?php information = array (
'name' => 'John',
'surname' => 'Doe'
); ?>
I serialize this array with php and put it into input's value:
<input type="hidden" id="information" name="information" value="<?php echo htmlentities(serialize($hidden_information)); ?>" />
Now JS part. I get this input's value:
var information = $('input#information').val();
And the question part: how can I now unserialize with JS this PHP serialized array? I want to unserialize 'information' variable.
When it will be unserialized, I want to alert name and surname from array.
Or probably, is there any possible way to get this name and surname without unserializing the array?