Jaswinder Posted June 25, 2013 Share Posted June 25, 2013 hello friends... i have learned about serialize(), unserialize(), __sleep(), __wakeup(), but i don't get any good example to use all these together.... so that i can practically understand these all properly.... so anyone can fetch me with good example.. also urlencode() and urldecode()..... for what exactly these are used??? any example?? Quote Link to comment https://forums.phpfreaks.com/topic/279539-problem-with-saving-an-object/ Share on other sites More sharing options...
PravinS Posted June 25, 2013 Share Posted June 25, 2013 explained with examples http://in3.php.net/manual/en/function.urlencode.php http://in3.php.net/manual/en/function.urldecode.php you can check other function too Quote Link to comment https://forums.phpfreaks.com/topic/279539-problem-with-saving-an-object/#findComment-1437756 Share on other sites More sharing options...
dalecosp Posted June 25, 2013 Share Posted June 25, 2013 hello friends... i have learned about serialize(), unserialize(), __sleep(), __wakeup(), but i don't get any good example to use all these together.... so that i can practically understand these all properly.... so anyone can fetch me with good example.. also urlencode() and urldecode()..... for what exactly these are used??? any example?? I have an application that reads the Internet and makes "data widgets", that is, representations of things it has read. Part of the application inspects these "data widgets" and assigns various bits of metadata to each one ... a "category", a "source", and so on. The next step to to move these widgets from a local server to a server on the West Coast. But rather than loop through this entire process, making a connection to the remote box each time, we pack up each "data widget" using serialize() and put it in a DB table which serves as a queue for the next step. The final step reads the DB table, loops through the results, unserialize()ing them back into their original object form, and pushing them out to the West Coast server. Does that help at all? You serialize() data in order to store it more concisely (the holding queue is 3 fields, while the object itself, if stored in a database, has a few dozen fields). You unserialize this data blob to turn it back into a usable object. Quote Link to comment https://forums.phpfreaks.com/topic/279539-problem-with-saving-an-object/#findComment-1437788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.