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)\"
i think this is the fastest way to get the words between the first parenthesis in a string.
$string = 'ignore everything except this (text)'; $string = explode(')', (explode('(', $string)[1]))[0]; echo $string;