preg_replace anything that isn't WORD

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

 



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

[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