Kyberia v2.3 - 1st revision from SVN (Without patches of kyberia.sk team)
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / function.str_split.php
diff --git a/inc/smarty/node_methodz/function.str_split.php b/inc/smarty/node_methodz/function.str_split.php
new file mode 100644 (file)
index 0000000..3ea337d
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+function smarty_function_str_split($params,&$smarty) {
+       if (!function_exists("str_split")) {
+               function str_split($str,$length = 1) {
+                       if ($length < 1) return false;
+                       $strlen = strlen($str);
+                       $ret = array();
+                       for ($i = 0; $i < $strlen; $i += $length) {
+                               $ret[] = substr($str,$i,$length);
+                       }
+                       return $ret;
+               }
+       }
+
+       $name = $params['name'];
+       if (!empty($name)) $array[$name] = str_split($params['string'],$params['length']);
+       else $array = str_split($params['string'],$params['length']);
+       $smarty->assign('str_split',$array);
+}
+?>
\ No newline at end of file
This page took 0.099379 seconds and 4 git commands to generate.