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

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  myZap   Lines 1516-1565 (49 lines)Updated: 2021-02-21 file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function myZap $a$u=)
        {
#-k     string text format
#-      This replaces characters that HTML would interpret, like '<', with similar-looking chars.
#-p     $u      - opt   - .<15> = 1 -- use Unicode ASCII
#-p                     - .<14> = 1 -- strip all HTML brackets except for <br>
#-p                     - .<13> = 1 -- strip all HTML brackets except for LF
#-d     4/7/12 - updated param to use Unicode ASCII if true
#-d     2/21/21 - updated $u to support HTML options

#       Unicode values for ASCII symbols
#$char[00] = [  '&#9216;', '&#9217;', '&#9218;', '&#9219;', '&#9220;', '&#9221;', '&#9222;', '&#9223;', '&#9224;', '&#9225;',
#               '&#9226;', '&#9227;', '&#9228;', '&#9229;', '&#9230;', '&#9231;', '&#9232;', '&#9233;', '&#9234;', '&#9235;',
#               '&#9236;', '&#9237;', '&#9238;', '&#9239;', '&#9240;', '&#9241;', '&#9242;', '&#9243;', '&#9244;', '&#9245;',
#               '&#9246;', '&#9247;', '&#9248;' ];
#$char[127] = '&#9249;';

        
$b '';

        for ( 
$i=0$i strlen($a); $i++ )
                {
                
$ch $a[$i];
                if ((
$u 2)  &&  ($ch == '<')  &&  $x=is_HTMLBreak($a,$i))
                        {
                        
$b .= substr($a,$i,$x-$i);
                        
$i $x;
                        
$ch '>';
                        }
                elseif (
$ch == '<')     $ch '&pr;';
                elseif (
$ch == '>')     $ch '&sc;';
                elseif ((
$u 4)  &&  ((ord($ch) == 9) || (ord($ch) == 10) || (ord($ch) == 13))) {  }   # Polish IF
                
elseif ($u 1)
                        {
                        if (
ord($ch) < 32)      $ch '&#' . (9216+ord($ch)) . ';';
                        elseif (
ord($ch) == 32$ch '&nbsp;';
                        elseif (
ord($ch) == 127$ch '&#9249;';
                        elseif (
ord($ch) > 126$ch '_';
                        }
                else
                        {
                        if (
ord($ch) < 32)      $ch '&bull;';
                        elseif (
ord($ch) > 126$ch '_';
                        }
                
$b .= $ch;
#[?]  U+2400   &#9216;  SYMBOL FOR NULL
                
}

        return 
$b;
        }

?>