W3docs

How to check if $_GET is empty?

You can check if the $_GET array is empty by using the empty() function.

You can check if the $_GET array is empty by using the empty() function.

For example:

Example of checking if $_GET is empty in PHP

php— editable, runs on the server

You can also use the count() function to check if the $_GET array has any elements:

Example of using count() function to check if $_GET is empty in PHP

php— editable, runs on the server