KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
$example = array('An example','Another example','Last example'); How can I do a loose search for the word "Last" in the above array? echo array_search('Last example',$example); The code above will only echo the value's key if the needle matches everything in the value exactly, which is what I don't want. I want something like this: echo array_search('Last',$example); And I want the value's key to echo if the value contains the word "Last".
Tags (comma-separated)
Save Edits
Cancel