Re: How do I replace a '_' with a space ?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: How do I replace a '_' with a space ?

From: Oli Filth <catch@olifilth.co.uk>
Date: Tue Oct 18 2005 - 19:46:05 CEST

Oliver Saunders said the following on 18/10/2005 18:06:
>> $string = "United_Kingdom";
>> $string = str_replace ("_", " ", $string);
>
>
> couldn't you also use preg_replace()? would that be faster?

You could preg_replace(), but I would imagine it would be orders of
magnitude slower, because regex-based matching is far more complex than
simple sub-string matching.

-- 
Oli
Received on Mon Oct 24 02:10:40 2005