Results of 1 - 10 of about 96 for substr (0.003 sec.)
- substr — 文字列の一部分を返す | PHP 8.3 13290
- substr (PHP 4, PHP 5, PHP 7, PHP 8) substr — 文字列の一部分を返す 説明 function substr ( string $string , int $offset , ? int $length = null ): string 文字列 string の、 offset で指定された位置から length バイト分の文字列を返します。 パラメ
... る文字列となります。 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
- substr_replace — 文字列の一部を置換する | PHP 8.3 11845
- substr_replace (PHP 4, PHP 5, PHP 7, PHP 8) substr_replace — 文字列の一部を置換する 説明 function substr_replace ( array | string $string , array | string $replace , array | int $offset , array | int | null $length = null ): string | array
... 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 ... ar の先頭に 'bob' を挿入します */ echo substr_replace ( $var , 'bob' , 0 , 0 ) . "<br />\n" ; /* 次の2つの例は、$var の 'MNRPQR' を 'bob'で置換します */ echo substr_rep ...
-
https://man.mtool.work/php/8.3/function.substr-replace.html
- substr_compare — 指定した位置から指定した長さの 2 つの文字列について、バイナリ... 10952
- 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 substr_compare() は、 haystack の offset 文字目以降の最大 length 文字を、 needle と比較します。 パラメータ haystack 比較したい最初 ... .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" , ... - 2 , 2 ), PHP_EOL ; // 0 echo substr_compare ( "abcde" , "bcg" , 1 , 2 ), PHP_EOL ; // 0 echo substr_compare ( "abcde" , "BC" , 1 , 2 , true ), PHP_EOL ; // 0 ...
-
https://man.mtool.work/php/8.3/function.substr-compare.html
- substr_count — 副文字列の出現回数を数える | PHP 8.3 10519
- substr_count (PHP 4, PHP 5, PHP 7, PHP 8) substr_count — 副文字列の出現回数を数える 説明 function substr_count ( string $haystack , string $needle , int $offset = 0 , ? int $length = null ): int substr_count() は、文字列 haystack の中での副
... なりました。 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 ... ' , 3 , 3 ), PHP_EOL ; // 重なっている副文字列はカウントされないので、1 が表示される $text2 = 'gcdgcdgcd' ; echo substr_count ( $text2 , 'gcdgcd' ), PHP_EOL ; // 5+10 > 14 なので、例外がスローされる echo substr_count ( $text , 'is' , 5 , 10 ) ...
-
https://man.mtool.work/php/8.3/function.substr-count.html
- iconv_substr — 文字列の一部を切り出す | PHP 8.3 9954
- iconv_substr (PHP 5, PHP 7, PHP 8) iconv_substr — 文字列の一部を切り出す 説明 function iconv_substr ( string $string , int $offset , ? int $length = null , ? string $encoding = null ): string | false 文字列 string の、 offset と length で指
... 定された一部を返します。 パラメータ string 元の文字列。 offset offset が負でない場合、 iconv_substr() は string の offset 番目の文字(ゼロから数えて)から切り出します。 offset が負の場合、 iconv_substr() は string の最後か ... 字列は offset から数えて最大 length 文字数分となります ( string の長さに依存します)。 もし負の length が渡された場合に iconv_substr() が切り出す文字列は、 string の offset 番目の文字からはじまり、文字列の最後から数えて length 文字分戻ったところまでとなり ... et や length のパラメータは、常に charset で定義された 文字セットにおける文字数と判断されることに注意してください。 一方、 substr() の場合はこれらの値を常に バイト数として判断します。 戻り値 文字列 string の、 offset と length で指定された一部を返します ...
-
https://man.mtool.work/php/8.3/function.iconv-substr.html
- mb_substr_count — 部分文字列の出現回数を数える | PHP 8.3 9402
- mb_substr_count (PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8) mb_substr_count — 部分文字列の出現回数を数える 説明 function mb_substr_count ( string $haystack , string $needle , ? string $encoding = null ): int 文字列 haystack の中での部分文字列 nee
... eError をスローするようになりました。 これより前のバージョンでは、 E_WARNING が発生し、 false を返していました。 例 例1 mb_substr_count() の例 <?php echo mb_substr_count ( "これはてすとです。" , "す" ); // 2 を出力する ?> 参考 mb_strpos() - 文字列の中に ... 指定した文字列が最初に現れる位置を見つける mb_substr() - 文字列の一部を得る substr_count() - 副文字列の出現回数を数える 他のマニュアルの関連ページ DuckDB Variant Functions Vim ...
-
https://man.mtool.work/php/8.3/function.mb-substr-count.html
- 関数のオーバーロード機能 | PHP 8.3 8785
- 関数のオーバーロード機能 警告 この機能は PHP 7.2.0 で 非推奨 になり、PHP 8.0.0 で 削除 されました。この機能に頼らないことを強く推奨します。 PHP アプリケーションの多くは、英語等のシングルバイトの言語用に設計されており、 日本語を含むマルチバイ
... ト文字列を扱う場合には問題を生じる場合があります。 substr() 等の PHP の文字列関数の多くは、 マルチバイト文字列に対応していません。 mbstring では、 対応するマルチバイト文字対応版の関 ... 数で既存の PHP 関数を オーバーロードする機能をサポートします。関数のオーバーロードを行うと、例えば substr() を PHP スクリプトでコールした場合に、 mb_substr() が代わりにコールされるようになります。 これにより、マルチバイト文字に対 ... 関数 オーバーロードする関数 1 mail() mb_send_mail() 2 strlen() mb_strlen() 2 strpos() mb_strpos() 2 strrpos() mb_strrpos() 2 substr() mb_substr() 2 strtolower() mb_strtolower() 2 strtoupper() mb_strtoupper() 2 stripos() mb_stripos() 2 strripos() mb_strri ...
-
https://man.mtool.work/php/8.3/mbstring.overload.html
- EventBuffer::substr — Subtracts a portion of the buffer data | PHP 8.3 8063
- EventBuffer::substr (PECL event >= 1.6.0) EventBuffer::substr — Subtracts a portion of the buffer data 説明 public function EventBuffer::substr ( int $start , int $length = ? ): string Subtracts up to length bytes of the buffer data beginni
...
-
https://man.mtool.work/php/8.3/eventbuffer.substr.html
- Swoole\Buffer::substr — Read data from the memory buffer based on offset and le... 7958
- Swoole\Buffer::substr (PECL swoole >= 1.9.0) Swoole\Buffer::substr — Read data from the memory buffer based on offset and length. Or remove data from the memory buffer. 説明 public function Swoole\Buffer::substr ( int $offset , int $length
...
-
https://man.mtool.work/php/8.3/swoole-buffer.substr.html
- grapheme_substr — 部分文字列を返す | PHP 8.3 7840
- grapheme_substr (PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0) grapheme_substr — 部分文字列を返す 説明 手続き型 function grapheme_substr ( string $string , int $offset , ? int $length = null , string $locale = "" ): string | false 部分文
... うになりました。 これより前のバージョンでは、 場合によっては空文字列ではなく false を返すことがありました。 例 例1 grapheme_substr() の例 <?php $char_a_ring_nfd = "a\xCC\x8A" ; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D" $c ... is_nfd = "o\xCC\x88" ; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D" print urlencode ( grapheme_substr ( "ao" . $char_a_ring_nfd . "bc" . $char_o_diaeresis_nfd . "O" , 2 , - 1 )); ?> 上の例の出力は以下となります。 a%CC%8Abco% ...
-
https://man.mtool.work/php/8.3/function.grapheme-substr.html