/libs/Haanga/Extension/Filter/Substr.php
PHP | 16 lines | 15 code | 1 blank | 0 comment | 3 complexity | ab7c4ea0e64d061f8a6bf48e661d6588 MD5 | raw file
Possible License(s): AGPL-1.0
- <?php
-
- class Haanga_Extension_Filter_Substr
- {
- public static function generator($cmp, $args)
- {
- if (count($args) != 2) {
- $cmp->Error("substr parameter must have one param");
- }
- if (!isset($args[1]['string'])) {
- $cmp->Error("substr parameter must be a string");
- }
- list($start, $end) = explode(",", $args[1]['string']);
- return hexec('substr', $args[0], (int)$start, (int)$end);
- }
- }