Answer

For any URL as a string:

if (parse_url($url, PHP_URL_QUERY)) {
    echo 'has query string';
} else {
    echo 'no query string';
}

If it's for the URL of the current request, simply:

if ($_GET)
  • 0
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions