title: Using Regular Expressions to parse functions from a string in PHP
body: <p>Is there a logical way to strip out function names and their arguments using Regular Expressions in PHP? Currently I have it splitting line by line so that I am able to have each function on each line for easier markup.</p>
  
  <p>So:</p>
  
  <pre><code>doSomeFunction(arg, moreargs, stuff);
  breakSomething();
  ini_set(include_path, /home/htdocs/);
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>array([0] =&gt; 'doSomeFunction(arg, moreargs, stuff);', [1] =&gt; 'breakSomething();' and so on...
  </code></pre>
  
  <p>The real problem I am having is getting the function name using regex to have syntax like:</p>
  
  <pre><code>$functionfromregex($args);
  </code></pre>
  
  <p>The functions are constructed using PHP's "Variable Function Name" ability, so it is possible. Arguments are taken in as arrays since there is no reasonable way to glue them togather the way that PHP needs to parse them as. The real downside is that I am not too familiar with Regular Expressions, any help will be greatly appreciated, and if you need any other information feel free to ask.</p>