PHP settype() လုပ်ဆောင်ချက်
❮ PHP Variable Handling ရည်ညွှန်းချက်
ဥပမာ
ကိန်းရှင်များကို သီးခြားအမျိုးအစားများသို့ ပြောင်းပါ-
<?php
$a = "32"; // string
settype($a, "integer"); // $a is now integer
$b = 32;
// integer
settype($b, "string"); // $b is now string
$c = true; //
boolean
settype($c, "integer"); // $c is now integer (1)
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
settype() function သည် variable တစ်ခုကို သီးခြားအမျိုးအစားတစ်ခုသို့ ပြောင်းပေးသည်။
အထားအသို
settype(variable, type);
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
variable | Required. Specifies the variable to convert |
type | Required. Specifies the type to convert variable to. The possible types are: boolean, bool, integer, int, float, double, string, array, object, null |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် သစ္စာ၊ ကျရှုံးမှုတွင် မှားသည်။ |
---|---|
ပြန်ပို့အမျိုးအစား- | ဘူလီယံ |
PHP ဗားရှင်း- | 4.0+ |
❮ PHP Variable Handling ရည်ညွှန်းချက်