note 95109 deleted from function.stripos by danbrown

From: Date: Mon, 14 Dec 2009 15:59:47 +0000
Subject: note 95109 deleted from function.stripos by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163939@lists.php.net to get a copy of this message
Note Submitter: Klark ---- It seems that stripos() is working similarly to mb_stripos(), meaning that it supports multi-byte character encoding. <?php $unicode_string = 'ϡϿӉԅש؁ضܓܛߨ◎✂➷Ⱡ—test¡¤Æ‰æ «“‹‘’›”» —–¾½¬ß¹²³´'; $search_for = 'ϡϿӉԅש؁ضܓܛߨ◎✂➷Ⱡ—test'; if (stripos($unicode_string, $search_for) === 0) { echo "Found using stripos! \n"; } if (mb_stripos($unicode_string, $search_for, 0, "UTF-8") === 0) { echo 'Found using mb_stripos!'; } /* Output: Found using stripos! Found using mb_stripos! */ ?> Tested on PHP 5.3 with Unicode UTF-8 strings and mbstring.func_overload turned off.

« previous php.notes (#163939) next »