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

Popular posts from this blog

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -