PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mb_strripos> <mb_strrchr
Last updated: Fri, 03 Oct 2008

view this page in

mb_strrichr

(PHP 5 >= 5.2.0)

mb_strrichr 大文字小文字を区別せず、 別の文字列の中である文字が最後に現れる場所を探す

説明

string mb_strrichr ( string $haystack , string $needle [, bool $part [, string $encoding ]] )

mb_strrichr() は、 haystack の中で最後に needle が現れる場所を探し、 haystack の部分文字列を返します。 mb_strrchr() とは異なり、 mb_strrichr() は大文字小文字を区別しません。 needle が見つからなかった場合は FALSE を返します。

パラメータ

haystack

needle が最後に現れる位置を探す文字列。

needle

haystack の中で探す文字列。

part

この関数が haystack のどの部分を返すのかを指定します。 TRUE の場合は、haystack の先頭から needle が最後に現れる位置までを返します。 FALSE の場合は、needle が最後に現れる位置から haystack の最後までを返します。 デフォルト値は FALSE です。

encoding

使用する文字エンコーディングの名前。 省略した場合は内部文字エンコーディングを使用します。

返り値

haystack の部分文字列を返します。 needle が見つからない場合は FALSE を返します。



add a note add a note User Contributed Notes
mb_strrichr
code at seanmacdonald dot ca
17-Jul-2008 01:09
for those of us who don't have PHP 5 >= 5.2.0 ::

function get_last_occurance($needle,$haystack){
    $chunk = explode($needle,$haystack);
    foreach ($chunk as $bit) $last_occurance = $bit;
    return $last_occurance;
}

mb_strripos> <mb_strrchr
Last updated: Fri, 03 Oct 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites