123456789101112131415 |
- <?php
- class UrlHelper {
- public static function getApiTree() {
- $lowercaseRequestUri = strtolower($_SERVER['REQUEST_URI']);
- $removedApiPath = str_replace("/api/", "", $lowercaseRequestUri);
- $removedQueryString = explode("?", $removedApiPath)[0];
- return explode("/", $removedQueryString);
- }
- public static function getTree() {
- return explode("/", str_replace("?".$_SERVER['QUERY_STRING'], "", trim(strtolower($_SERVER['REQUEST_URI']),"/")));
- }
- }
|