I have a lot of strings, and I need to check if each of them contains a color.
For example :
So, the two last strings must return true.
What is the best way to find it?
Regex, or check with any substr() ?
I always work with strpos
since it seems to be the fastest alternative (don't know about regex though).
if(strpos($haystack, $needle) !== FALSE) return $haystack;