0
$textvar = "Text(foo): " . func1("foo (bar)") . func2 ($some_arg);

What regex can I use to extract the above function names to verify the existance of these functions?

3
  • Do you mean Text in Text(foo)? Commented Apr 18, 2011 at 11:24
  • Or do you mean foo in foo (bar)? Commented Apr 18, 2011 at 11:26
  • I'd assume he means func1( and func2( and wants Text( and foo( ignored because they appear in strings. If so, a regex will be insufficient. See token_get_all. Commented Apr 18, 2011 at 11:33

1 Answer 1

1

How about this?

<? if(function_exists($function_name)) {
    //do something; 
}
?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.