Keys →
Functions ↓
function myZap ( $a, $u=4 ) {#-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] = [ '␀', '␁', '␂', '␃', '␄', '␅', '␆', '␇', '␈', '␉',# '␊', '␋', '␌', '␍', '␎', '␏', '␐', '␑', '␒', '␓',# '␔', '␕', '␖', '␗', '␘', '␙', '␚', '␛', '␜', '␝',# '␞', '␟', '␠' ];#$char[127] = '␡'; $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 = '≺'; elseif ($ch == '>') $ch = '≻'; 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 = ' '; elseif (ord($ch) == 127) $ch = '␡'; elseif (ord($ch) > 126) $ch = '_'; } else { if (ord($ch) < 32) $ch = '•'; elseif (ord($ch) > 126) $ch = '_'; } $b .= $ch;#[?] U+2400 ␀ SYMBOL FOR NULL } return $b; }?>