grapheme_stristr
(No version information available, might be only in CVS)
grapheme_stristr — 大文字小文字を区別せず、haystack 文字列の中で needle が最初に登場した場所以降の部分文字列を返す
説明
手続き型
string grapheme_stristr
( string $haystack
, string $needle
[, bool $before_needle
] )
大文字小文字を区別せず、haystack 文字列の中で needle が最初に登場した場所以降の部分文字列を返します。
パラメータ
- haystack
-
入力文字列。正しい形式の UTF-8 でなければなりません。
- needle
-
探したい文字列。正しい形式の UTF-8 でなければなりません。
- before_needle
-
TRUE の場合 (デフォルトは FALSE)、grapheme_strstr() は needle が最初に登場した場所より前の部分文字列を返します。
返り値
$haystack の部分文字列、あるいは $needle が見つからなかった場合に FALSE を返します。
例
例1 grapheme_stristr() の例
<?php
$char_a_ring_nfd = "a\xCC\x8A"; // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) normalization form "D"
$char_o_diaeresis_nfd = "o\xCC\x88"; // 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) normalization form "D"
$char_O_diaeresis_nfd = "O\xCC\x88"; // 'LATIN CAPITAL LETTER O WITH DIAERESIS' (U+00D6) normalization form "D"
print urlencode(grapheme_stristr( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_a_ring_nfd, $char_O_diaeresis_nfd));
?>
上の例の出力は以下となります。
o%CC%88a%CC%8A
参考
- grapheme_stripos() - 大文字小文字を区別せず、文字列内で最初にあらわれる場所の (書記素単位の) 位置を見つける
- grapheme_strpos() - 文字列内で最初にあらわれる場所の (書記素単位の) 位置を見つける
- grapheme_strripos() - 大文字小文字を区別せず、文字列内で最後にあらわれる場所の (書記素単位の) 位置を見つける
- grapheme_strrpos() - 文字列内で最後にあらわれる場所の (書記素単位の) 位置を見つける
- grapheme_strstr() - haystack 文字列の中で、needle が最初に登場した場所以降の部分文字列を返す
- » Unicode Text Segmentation: Grapheme Cluster Boundaries
grapheme_stristr
There are no user contributed notes for this page.
