php - String contains any items in an array (case insensitive) -
How can I check if any $ string
is expressed in the array in any object is?
$ string = 'My NEM is Tom.'; $ Array = array ("name", "tom");
Any ideas?
Did you want it? I hope code is being compiled :)
$ string = 'My NEM is Tom.'; $ Array = array ("name", "tom"); If (0 & lt; count (array_intersect (array_map ('strtolower', explosion ('', $ string), $ array)) {// do sth}
Comments
Post a Comment