stristrとは? わかりやすく解説

stristr

(PHP 4, PHP 5)
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のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



stristrのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2024 by the PHP Documentation Group.

©2024 GRAS Group, Inc.RSS