title: PHP: Best way to extract text within parenthesis?
body: <p>What's the best/most efficient way to extract text set between parenthesis? Say I wanted to get the string "text" from the string "ignore everything except this (text)" in the most efficient manner possible.</p>
  
  <p>So far, the best I've come up with is this:</p>
  
  <pre><code>$fullString = "ignore everything except this (text)";
  $start = strpos('(', $fullString);
  $end = strlen($fullString) - strpos(')', $fullString);
  
  $shortString = substr($fullString, $start, $end);
  </code></pre>
  
  <p>Is there a better way to do this? I know in general using regex tends to be less efficient, but unless I can reduce the number of function calls, perhaps this would be the best approach? Thoughts?</p>