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 ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook