mb_strstr
文字列の中で、指定した文字列が最初に現れる位置を見つける
説明
stringfalse mb_strstr(
string $haystack,
string $needle,
bool $before_needle = false,
stringnull $encoding = null
)
パラメータ
-
haystack
-
needle が最初に現れる位置を見つける文字列。
-
needle
-
haystack の中で探す文字列。
-
before_needle
-
この関数が haystack のどの部分を返すのかを指定します。
true の場合は、haystack の先頭から
needle が最初に現れる位置までを返します (needle を含めません)。
false の場合は、needle が最初に現れる位置から
haystack の最後までを返します (needle を含めます)。
-
encoding
-
使用する文字エンコーディング名。
省略した場合は内部文字エンコーディングが用いられます。
戻り値
haystack の部分文字列を返します。
needle が見つからない場合は false を返します。
参考
- stristr
- strstr
- mb_stristr