basic use of serialize()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
zyklone
Forum Commoner
Posts: 29
Joined: Tue Nov 28, 2006 10:25 pm

basic use of serialize()

Post by zyklone »

i just want to ask what is the basic use of serialize() function in php. thanks!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

to create a string of an array or an object.

read the manual serialize()
User avatar
zyklone
Forum Commoner
Posts: 29
Joined: Tue Nov 28, 2006 10:25 pm

Post 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?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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']);
Post Reply