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

str_contains

string တစ်ခုမှာပေးထားသောအလွှာတစ်ခုပါ 0 င်သည်ကိုဆုံးဖြတ်သည်
အမည်:str_contains
အမျိုးအစား:ကြိုး
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:string တစ်ခုမှာအခြား string တစ်ခုရှိမရှိစစ်ဆေးပါ

function name: strow_contains ()

function description: ဒီ function ကို string တစ်ခုမှာနောက်ထပ် string တစ်ခုရှိမရှိစစ်ဆေးဖို့အသုံးပြုသည်။

သက်ဆိုင်သောဗားရှင်း - PHP 8.0.0 နှင့်အထက်

အသုံးပြုမှု:

 bool str_contains ( string $haystack , string $needle )

Parametermer

  • $haystack : ရှာဖွေရန် string ကို။
  • $needle - ရှာဖွေရန်အလွှာ။

ပြန်လာတန်ဖိုး - $haystack တွင် $needle က true 0 င်ပါက false

ဥပမာ -

 $str = "Hello, world!"; $substring = "world"; if (str_contains($str, $substring)) { echo "字符串中包含子字符串"; } else { echo "字符串中不包含子字符串"; }

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

字符串中包含子字符串

မှတ်စုများ

  • str_contains() function ကိုအမှုအထိခိုက်မခံဖြစ်ပါတယ်။ အကယ်. သင်သည်ဖြစ်ရပ်အာရုံမခံစားနိုင်သောရှာဖွေမှုများကိုပြုလုပ်ရန်လိုအပ်ပါက stripos() function ကိုသုံးနိုင်သည်။
  • PHP 8.0.0 မတိုင်မီဗားရှင်းတွင် string တစ်ခုတွင် string တစ်ခုတွင် string တစ်ခုရှိမရှိစစ်ဆေးရန် strpos() function ကိုသုံးနိုင်သည် false PHP 8.0.0 ပြီးနောက် str_contains() function ကိုအသုံးပြုရန်အကြံပြုသည်။
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • မျိုးစုံ variable တွေကိုသို့ parse strings parse_str

    parse_str

    မျိုးစုံvariableတွေက
  • အခြား string တစ်ခုသို့ array သို့ခွဲရန် string တစ်ခုကိုသုံးပါ explode

    explode

    အခြားstringတစ်ခုသို့
  • string ကို encode လုပ်ဖို့ uuencode ကိုသုံးပါ convert_uuencode

    convert_uuencode

    stringကိုencodeလုပ်ဖ
  • strings များကို array သို့ပြောင်းပါ str_split

    str_split

    stringsများကိုarrayသ
  • string ကိုပေးထားသော substring နှင့်အတူအဆုံးသတ် str_ends_with

    str_ends_with

    stringကိုပေးထားသောsu
  • uuencode encoded string ကို decode convert_uudecode

    convert_uudecode

    uuencodeencodedstrin
  • မျက်နှာဖုံးနှင့်မကိုက်ညီသောအစအလွှာ၏အရှည်ကိုရယူပါ strcspn

    strcspn

    မျက်နှာဖုံးနှင့်မကို
  • တစ်ရှုထောင်ခင်းကျင်းတစ် ဦး string ကိုသို့တစ်ရှုထောင်ခင်းကျင်း၏တန်ဖိုးကိုပြောင်းပါ implode

    implode

    တစ်ရှုထောင်ခင်းကျင်း
လူကြိုက်များသော ဆောင်းပါးများ