grapheme_strstr
haystack 文字列の中で、needle が最初に登場した場所以降の部分文字列を返す
説明
手続き型
stringfalse grapheme_strstr(
string $haystack,
string $needle,
bool $beforeNeedle = false,
string $locale = ""
)
パラメータ
-
haystack
-
入力文字列。正しい形式の UTF-8 でなければなりません。
-
needle
-
探したい文字列。正しい形式の UTF-8 でなければなりません。
-
beforeNeedle
-
true の場合、grapheme_strstr
は needle が最初に登場した場所より前の haystack の部分文字列を返します (needle は含めません)。
-
locale
-
使用するロケール。
戻り値
haystack の部分文字列、あるいは needle が見つからなかった場合に false を返します。
例
例1 grapheme_strstr の例
<?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"
print urlencode(grapheme_stristr( $char_a_ring_nfd . $char_o_diaeresis_nfd . $char_a_ring_nfd, $char_o_diaeresis_nfd));
?>
上の例の出力は以下となります。