strstr
တစ် ဦး string ကို၏ပထမ ဦး ဆုံးဖြစ်ပျက်မှုကိုရှာပါ
function name: strstric ()
သက်ဆိုင်သောဗားရှင်း - PHP 4, PHP 5, PHP 7
function ကိုဖော်ပြချက် - strstring () function ကို string ကို string တစ်ခုအတွက် string ကိုရှာဖွေရန်နှင့် string အစွန်းအဆုံးအထိအပိုင်းကိုပြန်ပို့ရန်အသုံးပြုသည်။ အဘယ်သူမျှမအလွှာကိုရှာတွေ့ပါကမှားယွင်းစွာပြန်လာသည်။
Syntax: strstrack (string $ haystack, ရောနှောထားသော $ အပ်, bool $ _needle = false): string |
Parametermer
Value ကိုပြန်သွားပါ
ဥပမာ -
// 示例1:查找子字符串,并返回从子字符串开始到字符串结尾的部分$haystack = "Hello, world!"; $needle = "world"; $result = strstr($haystack, $needle); echo $result; // 输出:world! // 示例2:查找子字符串,并返回子字符串之前的部分$haystack = "Hello, world!"; $needle = ","; $result = strstr($haystack, $needle, true); echo $result; // 输出:Hello // 示例3:未找到子字符串,返回false $haystack = "Hello, world!"; $needle = "foo"; $result = strstr($haystack, $needle); var_dump($result); // 输出:bool(false)
မှတ်စုများ