On Sat, Aug 22, 2009 at 12:32 PM, ÈýÏÝÂÔdanondan...@gmail.com wrote:
Lets assume I have the string cats i saw a cat and a dog
i want to strip everything except cat and dog so the result will be
catcatdog,
using preg_replace.
I've tried something like /[^(dog|cat)]+/ but no success
Use preg_replace_callback instead!
preg_replace_callback is better performance than preg_replace with /e.
-
code
$str=cats i saw a cat and a dog;
$str1=preg_replace_callback(/(dog|cat|.)/is,call_replace,$str);
echo
hack988 hack988 wrote:
Use preg_replace_callback instead!
preg_replace_callback is better performance than preg_replace with /e.
-
code
$str=cats i saw a cat and a dog;
For the record Shawn: I received your previous post from Aug 22 and I
think that it is the best solution.
Jonathan
On Tue, Aug 25, 2009 at 12:41 AM, Shawn McKenzienos...@mckenzies.net wrote:
hack988 hack988 wrote:
Use preg_replace_callback instead!
preg_replace_callback is better performance
Lets assume I have the string cats i saw a cat and a dog
i want to strip everything except cat and dog so the result will be
catcatdog,
using preg_replace.
I've tried something like /[^(dog|cat)]+/ but no success
What should I do?
--
Use ROT26 for best security
5 matches
Mail list logo