Can I use a regular expression to search in an array?

I have an array of strings. I need to use regular expressions to search for strings in the array. Is it possible? If so, please explain..
$a = preg_grep("/search_word/",$array_of_strings);
print_r($a);

I have an array of strings. I need to use regular expressions to search for strings in the array. Is it possible? If so, please explain..

$a = preg_grep("/search_word/",$array_of_strings);
print_r($a);

Leave a Comment

Your email address will not be published.