Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-contentsParen

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  contentsParen   Lines 245-274 (29 lines) file  utilsDebug.php   Last mod: Mon 2021-05-03 17:55:24

function contentsParen $str$b=)
        {
#-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;
        }

?>