Need meaning of an if statement.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joelitos
Forum Newbie
Posts: 10
Joined: Sun May 17, 2009 12:43 am

Need meaning of an if statement.

Post by joelitos »

This are set ups values on the top of the page

Code: Select all

$submenu = false;
$cat = isset($_GET['subject']) && is_numeric($_GET['subject'])?$_GET['subject']:null;

And this line is within the code and uses those values.

Code: Select all

if($submenu == false && !is_null($cat) && $cat == $row['id'])
What this line means according to the set up values above?

in Special the $submenu variable why does its value needed to be assign to false here and then use it in that conditioned line?
gregor171
Forum Newbie
Posts: 22
Joined: Thu Apr 16, 2009 5:09 pm
Location: Ljubljana, Slovenia

Re: Need meaning of an if statement.

Post by gregor171 »

Looks like a part of navigator code.

I believe that there should be a line that sets $submenu somewhere up the code or in else sentence that follows if.

The other possibility is that a submenu haven't been implemented.

$cat in the other hand has integer value (what isn't best SEO practice) and matches the row id to enter if sentence.
Best seo practice would be string value to be careful (security) matched to a $submenu mapper.

I'm not sure that this answers the question?!
Post Reply