PHP unserialize() လုပ်ဆောင်ချက်
❮ PHP Variable Handling ရည်ညွှန်းချက်
ဥပမာ
အတွဲလိုက်ဒေတာကို တကယ့်ဒေတာအဖြစ်သို့ ပြန်ပြောင်းပါ-
<?php
$data = serialize(array("Red", "Green", "Blue"));
echo $data
. "<br>";
$test = unserialize($data);
var_dump($test);
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
unserialize() function သည် serialized data ကို အမှန်တကယ် data အဖြစ်သို့ ပြန်ပြောင်းပေးသည်။
အထားအသို
unserialize(string, options);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
string | Required. Specifies the serialized string |
options | Optional. Specifies options to be provided to the function, as an associative array. Can be either an array of class names which should be accepted, false to accept no classes, or true to accept all classes. True is default. |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | တန်ဖိုးပြောင်းသည်။ boolean၊ integer၊ float၊ string၊ array သို့မဟုတ် object ဖြစ်နိုင်သည်။ FALSE နှင့် ပျက်ကွက်ခြင်းဆိုင်ရာ E_NOTICE |
---|---|
ပြန်ပို့အမျိုးအစား- | Boolean၊ integer၊ float၊ string၊ array သို့မဟုတ် object |
PHP ဗားရှင်း- | 4.0+ |
PHP Changelog- | PHP 7.0- ရွေးချယ်စရာ ကန့် သတ်ဘောင် ကို ထည့်ထားသည်။ |
❮ PHP Variable Handling ရည်ညွှန်းချက်