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)\"
Use a regular expression:
if( preg_match( '!\(([^\)]+)\)!', $text, $match ) ) $text = $match[1];