forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
541 B
25 lines
541 B
<?php |
|
/** |
|
* Smarty plugin |
|
* |
|
* @package Smarty |
|
* @subpackage PluginsModifier |
|
*/ |
|
|
|
/** |
|
* Smarty explode modifier plugin |
|
* Type: modifier |
|
* Name: explode |
|
* Purpose: split a string by a string |
|
* |
|
* @param string $separator |
|
* @param string $string |
|
* @param int|null $limit |
|
* |
|
* @return array |
|
*/ |
|
function smarty_modifier_explode($separator, $string, ?int $limit = null) |
|
{ |
|
// provide $string default to prevent deprecation errors in PHP >=8.1 |
|
return explode($separator, $string ?? '', $limit ?? PHP_INT_MAX); |
|
}
|
|
|