What is this PHP Syntax: ($variation_id>0) ? $variation_id : $item_id;

Posted by user1325258 on Stack Overflow See other posts from Stack Overflow or by user1325258
Published on 2012-04-10T23:10:35Z Indexed on 2012/04/10 23:29 UTC
Read the original article Hit count: 129

Filed under:
|

Is someone able to explain the meaing of the following statment, and the type of php it is reffering to so I can do further research:

$foo = ($variation_id>0) ? $variation_id : $item_id;

I have tried search but don't really know what i'm searching for.

What I am trying to find out is the name and meaning of the following syntax ? / : and is ($variation_id>0) just a shorthand if statement ?

-- I just stumbled upon conditional variables although a nice simple explanation would still be appreciated.

© Stack Overflow or respective owner

Related posts about php

Related posts about syntax