note 37513 deleted from function.explode by didou
| From: | didou@php.net | Date: | Thu, 20 Nov 2003 10:09:32 +0000 |
| Subject: | note 37513 deleted from function.explode by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-60672@lists.php.net to get a copy of this message | ||
Note Submitter: siavash79_99@yahoo.com
----
This tiny function makes explode() case-insensitive:
just paste it at end of your code and use explodei() instead of explode().
have fun ;)
function explodei($separator, $string, $limit = 0 )
{
$string = ( $limit ) ? preg_replace( "/($separator)/i", $separator, $string, ($limit - 1)
) : preg_replace( "/($separator)/i", $separator, $string );
return ( $limit ) ? explode ( $saparator, $string, $limit) : explode ( $separator, $string);
}