From: Joe Presbrey Date: Wed, 12 Apr 2006 02:41:49 +0000 (+0000) Subject: move chars_encode to display library X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/commitdiff_plain/6e7cd1d32919a750f4182730bfc549b16a3bca86 move chars_encode to display library git-svn-id: svn://presbrey.mit.edu/sql/mitsql@103 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- diff --git a/lib/display.lib.php b/lib/display.lib.php index 4dfb81c..1b89004 100644 --- a/lib/display.lib.php +++ b/lib/display.lib.php @@ -60,4 +60,14 @@ function printBar($percent, $txt1 = '', $txt2 = '') { '; } +function chars_encode($string) { + $chars = array(); + $ent = null; + $chars = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); + for ($i = 0; $i < count($chars); $i++) + $ent[$i] = '&#' . ord($chars[$i]) . ';'; + if (sizeof($ent) < 1) return ''; + return implode('',$ent); +} + ?> diff --git a/tpl/head.php b/tpl/head.php index 8b17dae..bf2ea39 100644 --- a/tpl/head.php +++ b/tpl/head.php @@ -1,16 +1,5 @@