I have a string:
$string = 'This is Test';
And also an array of words:
$array = array('test','example','blahblah');
I want to look into the $string, and see if there is any of the words of $array in it or not:
$string_arr = explode(' ', $string);
foreach($string_arr as $value){
if (preg_match("/\b$value\b/iu", $array))
return true;
}
As you see, I used the 'u' flag for UTF-8 support, but the wired thing is that this works on my wamp(localhost), but on my real server on CentOs it's not working, I googled and I found this:
http://chrisjean.com/2009/01/31/unicode-support-on-centos-52-with-php-and-pcre/
But I don not have access to server to upgrade a RPM, so how I should do it?
Thanks in advance
Anybody could come up with another solution? I appreciate any help.