UrlHelper.class.php 458 B

123456789101112131415
  1. <?php
  2. class UrlHelper {
  3. public static function getApiTree() {
  4. $lowercaseRequestUri = strtolower($_SERVER['REQUEST_URI']);
  5. $removedApiPath = str_replace("/api/", "", $lowercaseRequestUri);
  6. $removedQueryString = explode("?", $removedApiPath)[0];
  7. return explode("/", $removedQueryString);
  8. }
  9. public static function getTree() {
  10. return explode("/", str_replace("?".$_SERVER['QUERY_STRING'], "", trim(strtolower($_SERVER['REQUEST_URI']),"/")));
  11. }
  12. }