From b537d04af11618f3efcc223cac4c1a3b01be8b67 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 19 Mar 2007 12:35:13 +0000 Subject: [PATCH] Added missing function str_split git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5821 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/functions.inc b/include/functions.inc index 62ef01a1e..5b35af77f 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -2131,6 +2131,23 @@ function is_php4() return (preg_match('/^4/', phpversion())); } +/* Add "str_split" if this function is missing. + * This function is only available in PHP5 + */ + if(!function_exists("str_split")){ + function str_split($str,$length =1) + { + if($length < 1 ) $length =1; + + $ret = array(); + for($i = 0 ; $i < strlen($str); $i = $i +$length){ + $ret[] = substr($str,$i ,$length); + } + return($ret); + } + } + + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> -- 2.30.2