Results of 1 - 10 of about 217 for substr (0.003 sec.)
- 文字列の一部分を返す 9980
- « strtr substr_compare » PHP Manual String 関数 文字列の一部分を返す 検索 substr (PHP 4, PHP 5, PHP 7, PHP 8) substr — 文字列の一部分を返す 説明 function substr ( string $string , int $offset , ? int $length = null ): string 文字列 string の
... る文字列となります。 string の長さが offset 文字より短い場合は、 空の文字列が返されます。 例1 負の offset の使用 <?php echo substr ( "abcdef" , - 1 ), PHP_EOL ; // "f" を返す echo substr ( "abcdef" , - 2 ), PHP_EOL ; // "ef" を返す echo substr ( "abcdef ... した場合、または null の場合は、 offset の位置から文字列の最後までの部分文字列を返します。 例2 負の length の使用 <?php echo substr ( "abcdef" , 0 , - 1 ), PHP_EOL ; // "abcde" を返す echo substr ( "abcdef" , 2 , - 1 ), PHP_EOL ; // "cde" を返す echo sub ... str ( "abcdef" , 4 , - 4 ), PHP_EOL ; // "" を返す; PHP 8.0.0 より前のバージョンでは、false を返していました。 echo substr ( "abcdef" , - 3 , - 1 ), PHP_EOL ; // "de" を返す ?> 戻り値 string の一部を返すか、空文字列を返します。 変更履歴 バージョ ...
-
https://man.mtool.work/php/8.3/function.substr.html
- 文字列の一部分を返す 9980
- « strtr substr_compare » PHP Manual String 関数 文字列の一部分を返す 検索 substr (PHP 4, PHP 5, PHP 7, PHP 8) substr — 文字列の一部分を返す 説明 function substr ( string $string , int $offset , ? int $length = null ): string 文字列 string の
... る文字列となります。 string の長さが offset 文字より短い場合は、 空の文字列が返されます。 例1 負の offset の使用 <?php echo substr ( "abcdef" , - 1 ), PHP_EOL ; // "f" を返す echo substr ( "abcdef" , - 2 ), PHP_EOL ; // "ef" を返す echo substr ( "abcdef ... した場合、または null の場合は、 offset の位置から文字列の最後までの部分文字列を返します。 例2 負の length の使用 <?php echo substr ( "abcdef" , 0 , - 1 ), PHP_EOL ; // "abcde" を返す echo substr ( "abcdef" , 2 , - 1 ), PHP_EOL ; // "cde" を返す echo sub ... str ( "abcdef" , 4 , - 4 ), PHP_EOL ; // "" を返す; PHP 8.0.0 より前のバージョンでは、false を返していました。 echo substr ( "abcdef" , - 3 , - 1 ), PHP_EOL ; // "de" を返す ?> 戻り値 string の一部を返すか、空文字列を返します。 変更履歴 バージョ ...
-
https://man.mtool.work/php/8.3/function.substr.html
- 指定した位置から指定した長さの 2 つの文字列について、バイナリ対応で比較する 9435
- « substr substr_count » PHP Manual String 関数 指定した位置から指定した長さの 2 つの文字列について、バイナリ対応で比較する 検索 substr_compare (PHP 5, PHP 7, PHP 8) substr_compare — 指定した位置から指定した長さの 2 つの文字列について、バイナ
... リ対応で比較する 説明 function substr_compare ( string $haystack , string $needle , int $offset , ? int $length = null , bool $case_insensitive = false ): int s ... 等しい (PHP 7.2.18, 7.3.5 より前のバージョン) か、 haystack より長い場合、 もしくは length が設定されていて0未満である場合、 substr_compare() は警告を表示して false を返します。 変更履歴 バージョン 説明 8.2.0 この関数は、2つの文字列の長さが等しくない場合 ... .0 length は、nullable になりました。 7.2.18, 7.3.5 offset の値は、 haystack の長さと等しくても問題なくなりました。 例 例1 substr_compare() の例 <?php echo substr_compare ( "abcde" , "bc" , 1 , 2 ), PHP_EOL ; // 0 echo substr_compare ( "abcde" , "de" , ...
-
https://man.mtool.work/php/8.3/function.substr-compare.html
- 指定した位置から指定した長さの 2 つの文字列について、バイナリ対応で比較する 9435
- « substr substr_count » PHP Manual String 関数 指定した位置から指定した長さの 2 つの文字列について、バイナリ対応で比較する 検索 substr_compare (PHP 5, PHP 7, PHP 8) substr_compare — 指定した位置から指定した長さの 2 つの文字列について、バイナ
... リ対応で比較する 説明 function substr_compare ( string $haystack , string $needle , int $offset , ? int $length = null , bool $case_insensitive = false ): int s ... 等しい (PHP 7.2.18, 7.3.5 より前のバージョン) か、 haystack より長い場合、 もしくは length が設定されていて0未満である場合、 substr_compare() は警告を表示して false を返します。 変更履歴 バージョン 説明 8.2.0 この関数は、2つの文字列の長さが等しくない場合 ... .0 length は、nullable になりました。 7.2.18, 7.3.5 offset の値は、 haystack の長さと等しくても問題なくなりました。 例 例1 substr_compare() の例 <?php echo substr_compare ( "abcde" , "bc" , 1 , 2 ), PHP_EOL ; // 0 echo substr_compare ( "abcde" , "de" , ...
-
https://man.mtool.work/php/8.3/function.substr-compare.html
- 文字列の一部を置換する 9351
- « substr_count trim » PHP Manual String 関数 文字列の一部を置換する 検索 substr_replace (PHP 4, PHP 5, PHP 7, PHP 8) substr_replace — 文字列の一部を置換する 説明 function substr_replace ( array | string $string , array | string $replace , a
... rray | int $offset , array | int | null $length = null ): string | array substr_replace() は、文字列 string の offset および (オプションの) length パラメータで区切られた部分を replace で指定した文字列に ... tring が配列の場合、配列が返されます。 変更履歴 バージョン 説明 8.0.0 length は、nullable になりました。 例 例1 シンプルな substr_replace() の例 <?php $var = 'ABCDEFGH:/MNRPQR/' ; echo "Original: $var <hr />\n" ; /* 以下の2つの例は、全ての $var で 'bob ... ' で置換します。 */ echo substr_replace ( $var , 'bob' , 0 ) . "<br />\n" ; echo substr_replace ( $var , 'bob' , 0 , strlen ( $var )) . "<br />\n" ; /* $v ...
-
https://man.mtool.work/php/8.3/function.substr-replace.html
- 文字列の一部を置換する 9320
- « substr_count trim » PHP Manual String 関数 文字列の一部を置換する 検索 substr_replace (PHP 4, PHP 5, PHP 7, PHP 8) substr_replace — 文字列の一部を置換する 説明 function substr_replace ( array | string $string , array | string $replace , a
... rray | int $offset , array | int | null $length = null ): string | array substr_replace() は、文字列 string の offset および (オプションの) length パラメータで区切られた部分を replace で指定した文字列に ... tring が配列の場合、配列が返されます。 変更履歴 バージョン 説明 8.0.0 length は、nullable になりました。 例 例1 シンプルな substr_replace() の例 <?php $var = 'ABCDEFGH:/MNRPQR/' ; echo "Original: $var <hr />\n" ; /* 以下の2つの例は、全ての $var で 'bob ... ' で置換します。 */ echo substr_replace ( $var , 'bob' , 0 ) . "<br />\n" ; echo substr_replace ( $var , 'bob' , 0 , strlen ( $var )) . "<br />\n" ; /* $v ...
-
https://man.mtool.work/php/8.3/function.substr-replace.html
- 副文字列の出現回数を数える 9078
- « substr_compare substr_replace » PHP Manual String 関数 副文字列の出現回数を数える 検索 substr_count (PHP 4, PHP 5, PHP 7, PHP 8) substr_count — 副文字列の出現回数を数える 説明 function substr_count ( string $haystack , string $needle , in
... t $offset = 0 , ? int $length = null ): int substr_count() は、文字列 haystack の中での副文字列 needle の出現回数を返します。 needle は英大小文字を区別することに注意してくだ ... なりました。 7.1.0 負の offset と length をサポートするようになりました。 length は、 0 を指定しても問題ありません。 例 例1 substr_count() の例 <?php $text = 'This is a test' ; echo strlen ( $text ), PHP_EOL ; // 14 echo substr_count ( $text , 'is' ), P ... HP_EOL ; // 2 // 文字列は 's is a test' になっているので, 1 が表示される echo substr_count ( $text , 'is' , 3 ), PHP_EOL ; // テキストは 's i' になっているので, 0 が表示される echo substr_count ( $text , 'is ...
-
https://man.mtool.work/php/8.3/function.substr-count.html
- 副文字列の出現回数を数える 9037
- « substr_compare substr_replace » PHP Manual String 関数 副文字列の出現回数を数える 検索 substr_count (PHP 4, PHP 5, PHP 7, PHP 8) substr_count — 副文字列の出現回数を数える 説明 function substr_count ( string $haystack , string $needle , in
... t $offset = 0 , ? int $length = null ): int substr_count() は、文字列 haystack の中での副文字列 needle の出現回数を返します。 needle は英大小文字を区別することに注意してくだ ... なりました。 7.1.0 負の offset と length をサポートするようになりました。 length は、 0 を指定しても問題ありません。 例 例1 substr_count() の例 <?php $text = 'This is a test' ; echo strlen ( $text ), PHP_EOL ; // 14 echo substr_count ( $text , 'is' ), P ... HP_EOL ; // 2 // 文字列は 's is a test' になっているので, 1 が表示される echo substr_count ( $text , 'is' , 3 ), PHP_EOL ; // テキストは 's i' になっているので, 0 が表示される echo substr_count ( $text , 'is ...
-
https://man.mtool.work/php/8.3/function.substr-count.html
- 部分文字列の出現回数を数える 8219
- « mb_substr mb_trim » PHP Manual マルチバイト文字列 関数 部分文字列の出現回数を数える 検索 mb_substr_count (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) mb_substr_count — 部分文字列の出現回数を数える 説明 function mb_substr_count ( string $haystack
... 中での部分文字列 needle の出現回数を返します。 変更履歴 バージョン 説明 8.0.0 encoding は、nullable になりました。 例 例1 mb_substr_count() の例 <?php echo mb_substr_count ( "これはてすとです。" , "す" ); // 2 を出力する ?> 参考 mb_strpos() - 文字列の中に ... 指定した文字列が最初に現れる位置を見つける mb_substr() - 文字列の一部を得る substr_count() - 副文字列の出現回数を数える 関連キーワード: mb substr 出現 回数 count haystack need ...
-
https://man.mtool.work/php/8.3/function.mb-substr-count.html
- 部分文字列の出現回数を数える 8219
- « mb_substr mb_trim » PHP Manual マルチバイト文字列 関数 部分文字列の出現回数を数える 検索 mb_substr_count (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) mb_substr_count — 部分文字列の出現回数を数える 説明 function mb_substr_count ( string $haystack
... 中での部分文字列 needle の出現回数を返します。 変更履歴 バージョン 説明 8.0.0 encoding は、nullable になりました。 例 例1 mb_substr_count() の例 <?php echo mb_substr_count ( "これはてすとです。" , "す" ); // 2 を出力する ?> 参考 mb_strpos() - 文字列の中に ... 指定した文字列が最初に現れる位置を見つける mb_substr() - 文字列の一部を得る substr_count() - 副文字列の出現回数を数える 関連キーワード: substr 出現 回数 count haystack needle ...
-
https://man.mtool.work/php/8.3/function.mb-substr-count.html