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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -