Page 1 of 1

basic use of serialize()

Posted: Thu Dec 14, 2006 10:19 pm
by zyklone
i just want to ask what is the basic use of serialize() function in php. thanks!

Posted: Thu Dec 14, 2006 10:29 pm
by Burrito
to create a string of an array or an object.

read the manual serialize()

Posted: Thu Dec 14, 2006 11:02 pm
by zyklone
Burrito wrote:to create a string of an array or an object.

read the manual serialize()
where can i use this function in my php code?

Posted: Thu Dec 14, 2006 11:08 pm
by Burrito
well in the case you asked about before in the other thread 8O

Code: Select all

<input type="checkbox" name="somecheck[]" value="1">
<input type="checkbox" name="somecheck[]" value="2">
<input type="checkbox" name="somecheck[]" value="3">
<input type="checkbox" name="somecheck[]" value="4">

Code: Select all

if(isset($_POST['somecheck']))
   $somestring = serialize($_POST['somecheck']);