diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/plugins/modifier.explode.php')
-rw-r--r-- | vendor/smarty/smarty/libs/plugins/modifier.explode.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/smarty/smarty/libs/plugins/modifier.explode.php b/vendor/smarty/smarty/libs/plugins/modifier.explode.php new file mode 100644 index 000000000..5186fde3d --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/modifier.explode.php @@ -0,0 +1,25 @@ +<?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); +} |