Jump to content

PHP ? syntax


TrimBalim

Recommended Posts

Hey everyone,
 
I'm working on some php code and for the first time, I've seen some syntax that goes as follows:

$Result = isset($mValues['Result']) ? $mValues['Result'] : 0;

I'm not exactly sure what this does, but I can take a stab at it:

it checks if the value $mValues['Result'] is set, the ? says to check if it's true, and if it is, set $mValues['Result'] to 0?

 

 

 

 

Thanks in advance for any help!

Link to comment
https://forums.phpfreaks.com/topic/278910-php-syntax/
Share on other sites

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.