Re: removing text from a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Thodoris wrote:
Ashley Sheridan a écrit :

Thats a lot of code when a couple of lines and a regex will do ;)
  Maybe because the use of the regex is pointless here. A bazooka to
kill the fly ? :)

I couldn't agree more. Not to mention that they are probably slower.

PS Don't get me wrong I like perl and pcre but it is pointless here.


Personal choice, and yes my testing has proven that a regex is faster then the multiple function calls or if conditions needed to accomplish the same
thing.


I think that no one will argue that (I like perl and its power to make regular expressions easy to use) but if you make the same thing with a simple function I think that is useless to call pcre because that adds some load to the script.

No much difference but you still have to think how to add the expression and check if it matches the right data...

--
Thodoris


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux