str_contains
string တစ်ခုမှာပေးထားသောအလွှာတစ်ခုပါ 0 င်သည်ကိုဆုံးဖြတ်သည်
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 ကိုသုံးနိုင်သည်။strpos()
function ကိုသုံးနိုင်သည် false
PHP 8.0.0 ပြီးနောက် str_contains()
function ကိုအသုံးပြုရန်အကြံပြုသည်။