Skip to content

Instantly share code, notes, and snippets.

@pedrorvidal
Created February 20, 2014 20:44
Show Gist options
  • Save pedrorvidal/9122842 to your computer and use it in GitHub Desktop.
Save pedrorvidal/9122842 to your computer and use it in GitHub Desktop.
Unserialize jquery serialized forms
//JS (Jquery)
var serializedData = $('#myForm').serialize();
$.post(
'getSerializedData.php',
{data:serializedData},
function(data){
}
)
// PHP
$serializedData = $_POST['data'];
$unserializedData = array();
parse_str($serializedData,$unserializedData);
print_r($unserializedData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment