Is there a PHP function like strpos(string haystack, string needle) but where needle is not a string, but a regular expression? I couldn't find one 🙁
What I want to do is to extract a substring that is enclosed by two regular expression matches. Like this:
function myfunc($regex1, $regex2, $string) {
// I don't know this part...
}
$mystring0 = "[Value0]foo0[/Value0]";
$mystring1 = "[Value1]foo1[/Value1]";
myfunc("[Value.]", "[/Value.]", $mystring0); // should return "foo0"
myfunc("[Value.]", "[/Value.]", $mystring1); // should return "foo1"
Thanx for your replies,
phlow