stristr
stristr — 大文字小文字を区別しない strstr()
説明
string stristr ( string haystack, string needle )haystack において needle が最初に見つかった位置から最後までを 返します。 needle および haystack は大文字小文字を区別せずに評価されます。
needle がない場合、FALSE を返します。
needle が文字列でない場合、整数に変換され、 通常の文字列として適用されます。
例 2310. stristr() の例
<?php
$email = 'USER@EXAMPLE.com';
echo stristr($email, 'e');
// ER@EXAMPLE.com を出力する
?>
例 2311. 文字列が見つかるかどうかをテストする
<?php
$string = 'Hello World!';
if(stristr($string, 'earth') === FALSE) {
echo '"earth" not found in string';
}
// 出力: "earth" not found in string
?>
例 2312. 非 "文字列" のneedle を使用する
<?php
$string = 'APPLE';
echo stristr($string, 97); // 97 = lowercase a
// 出力: APPLE
?>
注意: この関数はバイナリデータに対応しています。
strstr()、 strrchr()、 substr() および preg_match() も参照ください。
固有名詞の分類
Weblioに収録されているすべての辞書からstristrを検索する場合は、下記のリンクをクリックしてください。

- stristrのページへのリンク