public function getDesiredUrl(?string $url = null)
  {
    if (isset($_GET['url'])) {
      $url = $_GET['url'] . (count($_GET) > 0 ? '?' : '');
      unset($_GET['url']);

      foreach ($_GET as $key => $value) {
        $url .= (ends_with($url, '?') ? '' : '&') . $key . '=' . $value;
      }
    }

    if ($url != null) return $url;
    return false;
  }
public function getDesiredUrl(?string $url = null)
  {
    if (isset($_GET['url'])) {
      $url = $_GET['url'] . (count($_GET) > 0 ? '?' : '');
      unset($_GET['url']);

      foreach ($_GET as $key => $value) {
        $url .= (ends_with($url, '?') ? '' : '&') . $key . '=' . $value;
      }
    }

    if ($url != null) return $url;
    return false;
  }
public function getDesiredUrl ( ? string $ url = null ) { if ( isset ( $ _GET [ 'url' ] ) ) { $ url = $ _GET [ 'url' ] . ( count ( $ _GET ) > 0 ? '?' : '' ) ; unset ( $ _GET [ 'url' ] ) ; foreach ( $ _GET as $ key => $ value ) { $ url .= ( ends_with ( $ url , '?' ) ? '' : '&' ) . $ key . '=' . $ value ; } } if ( $ url != null ) return $ url ; return false ; }
Get desired endpoint

@param ?string $url
@return mixed
Get desired endpoint