Keys →
Functions ↓
function contentsParen ( $str, $b=0 ) {#-k string parse#- Return the contents up to the matching paren-type boundary. Understands nesting.#- if $str[$b] is '<', return contents up to matching '>' # prt(stackTrace(2,1) ); # 0123456789 123456789 1 # bi if ($str[$b] == '<') $c = '>'; elseif ($str[$b] == '(') $c = ')'; elseif ($str[$b] == '{') $c = '}'; elseif ($str[$b] == '"') $c = '"'; elseif ($str[$b] == "'") $c = "'"; else return ''; $j = strlen($str); $x = ''; $depth = 0; for ($i=$b+1;$i<$j;$i++) { if ($str[$i] == $c) $depth--; if ($depth < 0) break; if ($str[$i] == $str[$b]) $depth++; $x .= $str[$i]; } return $x; }?>