So I have an if statement in PHP that looks like this:
if ($_GET['Squares'] != 0)
but really I need to check if the variable squares has been passed via the url. So it needs to be if squares doesn’t exist. I tried the following but it throws errors.
if (!isset $_GET['Squares'])
Can anyone tell me what the correct syntax is please?
Add parentheses around the
isset()call:In PHP, all function calls have to have parentheses around the arguments. Be sure not to confuse language constructs as functions, such as
printandechowhich can be called without parenthesis.