serialize will convert object , array to single string with its type so it easy to store . transport and easy to use
in other word , we can say its return metadata and data for passed value
echo serialize(array("php","development",12));
will return
a:3:{i:0;s:3:"php";i:1;s:11:"development";i:2;i:12;} , now this string easy to store any varchar typed field at table at database.
class serialize{
var $serialize = array("php","easy","learn");
}
$serialize =new serialize();
echo serialize($serialize);
will return
O:9:"serialize":1:{s:9:"serialize";a:3:{i:0;s:3:"php";i:1;s:4:"easy";i:2;s:5:"learn";}}
if you want to return to his original form use unserialize
print_r(unserialize(serialize(array("php","development",12))));
will give you array as we define .