]> andersk Git - sql-web.git/blobdiff - lib/display.lib.php
move chars_encode to display library
[sql-web.git] / lib / display.lib.php
index 4dfb81c00b8a19a0868a265738e043d323f24500..1b890044774a4e2606677e61ac1222c43753b723 100644 (file)
@@ -60,4 +60,14 @@ function printBar($percent, $txt1 = '', $txt2 = '') {
                                </table>';
 }
 
+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);
+}
+
 ?>
This page took 0.024672 seconds and 4 git commands to generate.