url::has_query PHP Method

has_query() static public method

Checks if the URL has a query string attached
static public has_query ( string $url ) : boolean
$url string
return boolean
    static function has_query($url)
    {
        return str::contains($url, '?') ? true : false;
    }

Usage Example

Beispiel #1
0
 function get($url, $data = array(), $format = false, $options = array())
 {
     $query = http_build_query($data);
     $url = url::has_query($url) ? $url . '&' . $query : $url . '?' . $query;
     $response = self::request($url, false, $options);
     $content = a::get($response, 'content');
     if (error($response)) {
         return $response;
     }
     if (empty($content)) {
         return false;
     }
     if ($format) {
         return self::parse($content, $format);
     }
     return $content;
 }
All Usage Examples Of url::has_query