PHP stripos() လုပ်ဆောင်ချက်
ဥပမာ
string အတွင်းရှိ "php" ၏ပထမဆုံးဖြစ်ပျက်မှုအနေအထားကိုရှာပါ-
<?php
echo stripos("I love php, I love php too!","PHP");
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
stripos() function သည် အခြားသော string အတွင်းရှိ string တစ်ခု၏ ပထမဆုံး ဖြစ်ပေါ်မှု အနေအထားကို ရှာဖွေသည်။
မှတ်ချက်- stripos() function သည် case-insensitive ဖြစ်သည်။
မှတ်ချက်- ဤလုပ်ဆောင်ချက်သည် binary-safe ဖြစ်သည်။
ဆက်စပ်လုပ်ဆောင်ချက်များ-
- strripos() - အခြား string အတွင်းရှိ စာကြောင်းတစ်ခု၏ နောက်ဆုံးဖြစ်ပျက်မှု အနေအထားကို ရှာပါ (စာလုံးအသေးမပါသော)
- strpos() - အခြား string အတွင်းရှိ string တစ်ခု၏ ပထမဆုံး ပေါ်ပေါက်မှု အနေအထားကို ရှာပါ (case-sensitive)
- strrpos() - အခြား string အတွင်းရှိ စာကြောင်းတစ်ခု၏ နောက်ဆုံးဖြစ်ပေါ်မှု အနေအထားကို ရှာပါ
အထားအသို
stripos(string,find,start)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
string | Required. Specifies the string to search |
find | Required. Specifies the string to find |
start | Optional. Specifies where to begin the search |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အခြားစာကြောင်းတစ်ခုအတွင်းရှိ စာကြောင်းတစ်ခု၏ ပထမဆုံးဖြစ်ပေါ်မှု အနေအထားကို ပြန်ပေးသည်၊ သို့မဟုတ် စာကြောင်းကို ရှာမတွေ့ပါက FALSE ပြန်ပေးသည်။ မှတ်ချက်- ကြိုးတန်းရာထူးများသည် 0 မှစတင်သည်၊ 1 မဟုတ်ပါ။ |
---|---|
PHP ဗားရှင်း- | ၅+ |
❮ PHP String အကိုးအကား