Jump to content

Ternary Operator Help


dennismonsewicz

Recommended Posts

I have the following code that is supposed to display a particular value depending on the IF statement evaluating to being true:

 

value="<?php (isset($savings)) ? $savings : $bigZero;?>"

 

$savings is being set from the DB and $bigZero is set like this:

 

$bigZero = "$000.00";

 

When I run my script nothing is displayed for the value.

Link to comment
https://forums.phpfreaks.com/topic/184002-ternary-operator-help/
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.