summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/html.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/html.inc.php')
-rw-r--r--frontends/php/include/html.inc.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontends/php/include/html.inc.php b/frontends/php/include/html.inc.php
index 46c1d137..49204077 100644
--- a/frontends/php/include/html.inc.php
+++ b/frontends/php/include/html.inc.php
@@ -44,6 +44,17 @@
return str_replace(" ",SPACE,$str);;
}
+ function utf8_strlen($s)
+ {
+ return preg_match_all('/([\x01-\x7f]|([\xc0-\xff][\x80-\xbf]{1,5}))/', $s, $tmp);
+ }
+
+ function utf8_strtop($s, $len)
+ {
+ preg_match('/^([\x01-\x7f]|([\xc0-\xff][\x80-\xbf]{1,5})){0,'.$len.'}/', $s, $tmp);
+ return (isset($tmp[0])) ? $tmp[0] : false;
+ }
+
function form_select($var, $value, $label)
{
global $_REQUEST;