How can i check if a $string
contains any of the items expressed in an array?
$string = 'My nAmE is Tom.';
$array = array("name","tom");
if(contains($string,$array))
{
// do something to say it contains
}
Any ideas?
How can i check if a $string
contains any of the items expressed in an array?
$string = 'My nAmE is Tom.';
$array = array("name","tom");
if(contains($string,$array))
{
// do something to say it contains
}
Any ideas?
One more workaround for contains function
PS. as for me, I'm just use it without function..
Will this do the job?
Much simpler, please refer the link in_array