လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> mb_strripos

mb_strripos

ကိစ္စတွင် string တစ်ခုအတွက် string တစ်ခု၏နောက်ဆုံးတည်နေရာကိုတွေ့ကြုံခံစားပါ
အမည်:mb_strripos
အမျိုးအစား:Multi-byte string ကို
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:အခြား string တစ်ခုတွင်သတ်မှတ်ထားသော string ၏နောက်ဆုံးတည်နေရာကိုပြန်ပို့သည်။

function name: mb_stripos ()

သက်ဆိုင်သောဗားရှင်း: PHP 4> = 4.2.0, PHP 5, PHP 7

function ကိုဖော်ပြချက် - MB_Strripos () function သည်အခြား string တစ်ခုတွင်သတ်မှတ်ထားသော string ကိုပြန်ပို့သည်။ string ကိုရှာမတွေ့ပါကမှားယွင်းသောအယူမှားသည်။

Syntax: MB_Stripropos (string $ haystack, string $ အပ်ခြင်း, INT $ offset = 0, string ကို $ encoding = null): int | int | bool

Parametermer

  • $ haystack: အတွက်ရှာဖွေရန် string ကို။
  • $ အပ် - တွေ့ရမည့် string ကို။
  • $ offset: optional parameter, string ကို၏သတ်မှတ်ထားသောအနေအထားကနေရှာဖွေခြင်း (ပုံမှန်အားဖြင့် 0) ။
  • $ encoding: optional parameter သည်အသုံးပြုရန် Encoding encoding ကိုသတ်မှတ်ခြင်း (ပုံမှန်ဇာတ်ကောင် encoding)

Value ကိုပြန်သွားပါ

  • သတ်မှတ်ထားသော string ကိုတွေ့လျှင် (ကိန်းဂဏန်းပုံစံဖြင့်) (integer form) တွင်နောက်ဆုံးဖြစ်ပျက်မှုအနေအထားကိုပြန်ပို့သည်။
  • သတ်မှတ်ထားသော string ကိုရှာမတွေ့ပါကမှားယွင်းစွာပြန်လာသည်။

ဥပမာ 1:

 $string = "Hello, World!"; $needle = "world"; $position = mb_strripos($string, $needle); if ($position !== false) { echo "找到了needle 在haystack 中的位置:$position"; } else { echo "未找到needle 在haystack 中"; }

ထုတ်လုပ်မှု -

找到了needle 在haystack 中的位置:7

ဥပမာ 2:

 $string = "Hello, World!"; $needle = "WORLD"; $position = mb_strripos($string, $needle); if ($position !== false) { echo "找到了needle 在haystack 中的位置:$position"; } else { echo "未找到needle 在haystack 中"; }

ထုတ်လုပ်မှု -

找到了needle 在haystack 中的位置:7

မှတ်စုများ

  • MB_Strripos () function သည်စာလုံးအသေးနှင့်အများအားဖြင့်အာရုံမခံစားနိုင်သည့်အမှုနှင့်မခံစားနိုင်သောပွဲများကိုရှာဖွေနိုင်သည်။
  • အကယ်. $ offset parameter ကိုသတ်မှတ်ပါက function သည်သတ်မှတ်ထားသောနေရာမှရှာဖွေမှုကိုစတင်သည်။
  • အကယ်. $ encoding parameter သည်သတ်မှတ်ထားသောလျှင်, function ကိုသတ်မှတ်ထားသောဇာတ်ကောင် encoding နှင့်အတူရှာဖွေလိမ့်မယ်။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
လူကြိုက်များသော ဆောင်းပါးများ