From 6e7cd1d32919a750f4182730bfc549b16a3bca86 Mon Sep 17 00:00:00 2001 From: Joe Presbrey Date: Wed, 12 Apr 2006 02:41:49 +0000 Subject: [PATCH] move chars_encode to display library git-svn-id: svn://presbrey.mit.edu/sql/mitsql@103 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- lib/display.lib.php | 10 ++++++++++ tpl/head.php | 11 ----------- tpl/menu.php | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) 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 @@ -- 2.45.0