1 | <?php |
||
27 | class Utilities |
||
28 | { |
||
29 | /** |
||
30 | * Replace / with the system directory separator |
||
31 | * |
||
32 | * @param string $path the original path |
||
33 | * |
||
34 | * @return mixed |
||
35 | */ |
||
36 | 1 | public static function normalizeDirectorySeparator($path) |
|
40 | |||
41 | /** |
||
42 | * explode an array by lines that match a regular expression |
||
43 | * |
||
44 | * @param array $array the original array, should be a non-associative array |
||
45 | * @param string $regexp the regular expression |
||
46 | * |
||
47 | * @return array an array of array pieces |
||
48 | * @throws \InvalidArgumentException |
||
49 | */ |
||
50 | 3 | public static function pregSplitArray($array, $regexp) |
|
73 | |||
74 | /** |
||
75 | * @param array $array a flat array |
||
76 | * @param string $regexp a regular expression |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | 20 | public static function pregSplitFlatArray($array, $regexp) |
|
99 | |||
100 | /** |
||
101 | * Tell if an array is associative |
||
102 | * |
||
103 | * @param array $arr an array |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | 3 | public static function isAssociative($arr) |
|
111 | } |
||
112 |