How do i extract a function call with arguments from a source file?
| From: | Mathijs van Veluw | Date: | Wed, 18 Oct 2006 09:28:06 +0000 |
| Subject: | How do i extract a function call with arguments from a source file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-243277@lists.php.net to get a copy of this message | ||
Hello there,
Is there a way to extract a function call with its arguments?
Like i have something like this:
=CODE==================================
<?php
//Some Comments
print_r(ClassName::FunctionName('foo', 'bar', Array(), false));
$fooBar = ClassName::FunctionName('foo', 'bar');
?>
=CODE==================================
Now i want to extract the ClassName::FunctionName() part, inculding its arguments.
The first two arguments are required, the last two/three arn't.
How can i extract/match/replace this part?
Thx in advance.