Jump to content

don't understand this code


Mr.Shawn

Recommended Posts

It means if that if $_SERVER['REQUEST_URI'] is not set, then $requested is false.  Otherwise, it is set to its value.  

 

? : is an easy way to do quick if/else syntax

 

 

$value=($number<0)? "negative": "positive";

 

If the condition in (here) is true, the $value gets set to the first value.  If not, it's the second one.  Of course zero is not really positive, but you get the point.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.