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.
serialize() function किसी value को storable form में convert करता है , इस process को serialization कहते हैं।
serialization एक ऐसी process है जिसमे किसी Data Structure या Object को Byte Stream में convert करना जिससे उसे किसी storage (जैसे file or memory data buffer) में store किया जा सके या किसी network पर send किया जा सके।
PHP में serialize() function , data के type और structure में changes किये बिना store करने के लिए बहुत useful है।
serialize( mixed $value );
mixed $value | required : variable जिसे आपको serialized करना है।
Return Value : एक string return होती है जो की pass की गयी value का byte-stream representation होता है , जिसे आप कहीं भी store / transmit कर सकते हैं।
<?php $var = ['name' => 'rahul Kumar', 'age' => 24, 'marriage'=> false]; echo serialize($var); ?>Output
a:3:{s:4:"name";s:11:"rahul Kumar";s:3:"age";i:24;s:8:"marriage";b:0;}
data serialized होने के बाद कुछ इस तरह से convert होता है। serialized String में आपको हर value के बारे में complete info मिलेगी जैसे (data type , length etc. ).
Example में एक Associative Array को serialized किया गया है। Output में आप देख सकते हैं किसी तरह से value के साथ - साथ key के type और length को manage किया गया है।
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