| @@ 180-187 (lines=8) @@ | ||
| 177 | * |
|
| 178 | * @return string[]|false |
|
| 179 | */ |
|
| 180 | public static function getPrefix($string) |
|
| 181 | { |
|
| 182 | if (false !== ($matches = self::asPrefix($string))) { |
|
| 183 | return $matches[2]; |
|
| 184 | } |
|
| 185 | ||
| 186 | return false; |
|
| 187 | } |
|
| 188 | ||
| 189 | /** |
|
| 190 | * Return string without prefix (if exist). |
|
| @@ 196-203 (lines=8) @@ | ||
| 193 | * |
|
| 194 | * @return string |
|
| 195 | */ |
|
| 196 | public static function subPrefix($string) |
|
| 197 | { |
|
| 198 | if (false !== ($matches = self::asPrefix($string))) { |
|
| 199 | return $matches[1].$matches[7]; |
|
| 200 | } |
|
| 201 | ||
| 202 | return $string; |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * Format string into URL. |
|