Last active
November 4, 2016 00:47
-
-
Save edavis25/986d88f195f6348b6f9e82cd7d6c3491 to your computer and use it in GitHub Desktop.
Parse JSON string as PHP array.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Create a simple javascript array and call the JSON "stringify" method upon it. | |
* Pass the stringified array variable via the URL & GET method and use this line to turn it into a standard PHP array. | |
*/ | |
$array = json_decode(str_replace('\\', '', $_REQUEST['URL-PARAM-NAME'])); | |
// URL-PARAM-NAME = whatever name the JSON string was given when passed via URL (keep single quotes) | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment