Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/smarty/plugins/ |
<?php /** * Smarty plugin * @package Smarty * @subpackage PluginsModifier */ /** * Smarty spacify modifier plugin * * Type: modifier<br> * Name: spacify<br> * Purpose: add spaces between characters in a string * * @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual) * @author Monte Ohrt <monte at ohrt dot com> * @param string $ * @param string $ * @return string */ function smarty_modifier_spacify($string, $spacify_char = ' ') { // mb_ functions available? if (function_exists('mb_strlen') && mb_detect_encoding($string, 'UTF-8, ISO-8859-1') === 'UTF-8') { $strlen = mb_strlen($string); while ($strlen) { $array[] = mb_substr($string, 0, 1, "UTF-8"); $string = mb_substr($string, 1, $strlen, "UTF-8"); $strlen = mb_strlen($string); } return implode($spacify_char, $array); } else { return implode($spacify_char, preg_split('//', $string, -1)); } } ?>