1 | <?php |
||
23 | class StrUtil |
||
24 | { |
||
25 | /** |
||
26 | * Wraps $needle in $wrapEle HTML tags if found in $haystack. |
||
27 | * |
||
28 | * @param string $haystack |
||
29 | * @param string $needle |
||
30 | * @param string $wrapEle |
||
31 | * @param boolean $wrapHaystackOnFailure |
||
32 | * @return string |
||
33 | */ |
||
34 | public static function wrapSubstr( |
||
65 | |||
66 | /** |
||
67 | * Truncats $string to $maxLength and appends '...' |
||
68 | * |
||
69 | * @param string $string The string to truncate |
||
70 | * @param $maxLength Maximum character length (excluding ellipse) of returned string. |
||
71 | * @return string Returns $string unaltered if it's shorter then $maxLength. |
||
72 | * Otherwise $string is returned truncated to $maxLength with '...' |
||
73 | * appended. |
||
74 | */ |
||
75 | public static function ellipse($string, $maxLength) |
||
82 | } |
||
83 |