I'm trying to search through some files in PHP
and I want to give the user a choice between matching any or every term.
E.g.: Search terms: [apple,banana]
Is it possible to return only files that have both words in it?
Also my OR would use the following:
$s_terms = "(" . implode("|", explode(",", $s_terms)) . ")";
I want to separate terms with ,
and use it in a RegEx
match like (apple|banana)
. Does the above code do that?
Thank you in forward
EDIT:
The other question did not answer my question, but I found something that works:(.*apple.*banana.*)
No comments:
Post a Comment