I’m currently AJAX’ing a login form.
var data = $(this).serialize();
This is the data I’m sending, I get this with PHP using Codeigniter like so:
$ajax = $this->input->post('data');
This returns username=john&password=doe as you’d expect.
How do I turn that into an array? I’ve tried doing unserialize() and I get null.
I believe you can use PHP’s
parse_str()function: http://php.net/manual/en/function.parse-str.phpUsing your code it would be: