Relative Content

Tag Archive for javascriptphpjquery

Prepare Javascript JSON for PHP to decode

I have a form with an input textfield where I am storing a Javascript array in JSON format. This way, when I click the submit button, the server gets the information with PHP from the $_POST array. I noticed that I had to replace ‘[‘ and ‘]’ by ‘{‘ and ‘}’, however I can’t replace the from the JSON in PHP, the str_replace function does not execute this replacement.

Prepare Javascript JSON for PHP to decode

I have a form with an input textfield where I am storing a Javascript array in JSON format. This way, when I click the submit button, the server gets the information with PHP from the $_POST array. I noticed that I had to replace ‘[‘ and ‘]’ by ‘{‘ and ‘}’, however I can’t replace the from the JSON in PHP, the str_replace function does not execute this replacement.