php: best proceed mislay calm within parenthesis?
what's best/most fit proceed mislay calm set between parenthesis? contend i wanted twine "text" twine "ignore all solely (text)" many fit feeling possible.
so far, best i've adult this:
$fullstring = "ignore all solely (text)";
$start = strpos('(', $fullstring);
$end = strlen($fullstring) - strpos(')', $fullstring);
$shortstring = substr($fullstring, $start, $end);
is there improved proceed this? i know whole controlling regex tends reduction efficient, nonetheless unless i devaluate array duty calls, maybe best approach? thoughts?
Comments
Post a Comment