When making forms ever had the urge to find something easier than having to define every value in your JavaScript? I did and found something nice called serialize. What is does is add all values into 1 string. Because I began to like serialize I’m writing an article on the use of it.
Lately I see a lot of people writing their own functions to deserialize it in php not knowing that php has it’s own function for deserializing namely ‘parse_str’. What it does is get the values and put them into an array so you can access them individually. Here is a little code for example:
This is the Template
This is the php handler (search.php)
Man it’s so easy to use serialize
Robert-Jan de Dreu's Picture
About Robert-Jan de Dreu
Hey, I’m Robert-Jan de Dreu. A freelance software engineer, developing software since 2009. While using PHP and Javascript I build well structured and tested software.
Comments