Ok, I'm feeling retarded here,
I have a string like so:
$string = 'function module_testing() {';
or it could be like this:
$string = 'function module_testing()';
or it could be like this:
$string = 'function module_testing($params) {';
or this:
$string = 'function module_testing($params, $another = array())';
and many more ways...
And than I have an array of strings like so:
$string_array = array('module_testing', 'another_function', 'and_another_function');
Now, is there some sort of preg_match
that I can do to test if any of the $string_array
values are found within the $string
string at any given position? So in this situation, there would be a match. Or is there a better way to do this?
I can't use in_array
since it's not an exact match, and I'd rather not do a foreach
loop on it if I can help it, since it's already in a while
loop.
Thanks :)