mb_strstr
အခြား string တစ်ခုအတွက် string ကို၏ပထမ ဦး ဆုံးဖြစ်ပျက်မှုကိုရှာပါ
function name: mb_strstrstric ()
သက်ဆိုင်သောဗားရှင်း - PHP 4> = 4.0.6, PHP 5, PHP 7, PHP 8
အသုံးပြုမှု: MB_Strstrtrcrcrcrcre (string $ haystack, string ကို $ အပ်, bool $ _needle = false, string $ encoding = null): string |
ဖော်ပြချက် - MB_Strstrstrcr () function ကို string ကို $ haystack တွင်အလွှာအလွှာကိုရှာဖွေရန်နှင့် $ အပ်ပြီးနောက် string ကိုပြန်ပို့ရန်အသုံးပြုသည်။ ဤလုပ်ဆောင်ချက်သည်ဇာတိ strstred () function နှင့်ဆင်တူသော်လည်း Multibyte ဇာတ်ကောင်အစုံများကိုလည်းထောက်ပံ့သည်။
Parametermer
Value ကိုပြန်သွားပါ
ဥပမာ -
$str = "Hello, World!"; $needle = "World"; // 在$str 中查找$needle 并返回$needle 后的部分字符串$result = mb_strstr($str, $needle); echo $result; // 输出: World! // 在$str 中查找$needle 并返回$needle 之前的部分字符串$result = mb_strstr($str, $needle, true); echo $result; // 输出: Hello, // 使用指定的字符编码进行查找$str = "你好,世界!"; $needle = "世界"; $result = mb_strstr($str, $needle, false, 'UTF-8'); echo $result; // 输出: 世界!
မှတ်စုများ