If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
unserialize() function , serialized data को un-serialize करके उसे PHP Value में convert करता है। या कह सकते हैं stored representation data को PHP Value में convert करता है।
यह function , serialize() function के just apposite काम करता है।
unserialize ( string $data , array $options = [] );
string $data | required : यह serialized string data है जिसे हम un-serialize करना चाहते हैं।
array $options | optional : यह optional में आप Associative Array pass कर सकते है , allowed_classes => true / false pass किया जाता है। By Default true ही होता है जिसका मतलब classes allowed हैं। और false का मतलब कोई भी class allowed नहीं है।
File : php_unserialize.php
<?php
$var = ['name' => 'rahul Kumar', 'age' => 24];
$data = serialize($var);
echo $data ."br>";
/*now un-serialized it*/
print_r( unserialize($data) );
?>
a:2:{s:4:"name";s:11:"rahul Kumar";s:3:"age";i:24;} Array ( [name] => rahul Kumar [age] => 24 )
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook