lundi 30 mai 2016

The use of parenthesis inside an if statement

I am in the process of learning PHP development as a beginner i would like to ask question regarding the use of if with isset. Here the two code:

Is there any difference between these two pieces of code:

if ( (isset($_GET['id'])) && (is_numeric($_GET['id'])) )

And:

if (isset($_GET['s']) && is_numeric($_GET['s']))

In the first part the isset() and is_numeric() are inside an additional set of parenthesis.

But in the second they reside inside the if()'s parenthesis.

Is there any difference between the first and second snippet?

Thanks in advance for any explanation and clarification.

Aucun commentaire:

Enregistrer un commentaire