|
Posted by Simon on 03/11/06 14:13
> Simon wrote:
>> would anybody have a version of str_irepalce(),
>> (http://uk.php.net/manual/en/function.str-ireplace.php) for php4?
>>
>> The doc mentions eregi_replace() and preg_repalce() but I cannot get
>> my head around it.
>>
>
> if (!function_exists('str_ireplace')) {
> function str_ireplace($needle, $str, $haystack) {
> return preg_replace("/$needle/i", $str, $haystack);
> }
> }
>
>
Thanks!
Just out of curiosity, would it work if $needle, $str, $haystack had
escape/special characters?
Simon
[Back to original message]
|