Data to the server comes in the form of such a string:

sport[]=1&music[]=0&web[]=2 

How to disperse it in php?

option

 $data = unserialize($post["data"]); 

For some reason causes an error:

 ErrorException [ 8 ]: unserialize() [function.unserialize]: Error at offset 0 of 27 bytes ~ APPPATH\classes\controller\ajax.php [ 14 ] 

    1 answer 1

    This is not a serialized array! parse_str to help you.

    • me on stackoverflow, too, so answered. - Smash