Avatar of Lightwalker
Lightwalker
 asked on

Help breaking down a this php code

Hi All,

I having been getting some help with a custom store that I am building and have been given a piece of code by support that works but I do not understand how and would be grateful if someone could break it down for me.

.(isset($_SESSION['currencySymbol']))?$_SESSION['currencySymbol']:"$".

I understand the isset. So for me this statement says if session "currencySymbol" exists, but I do not know what the ? is for at the end as well as the :"$"
PHP

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
bigeven2002

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

What he said.  See Ternary Operator on this page: http://www.php.net/manual/en/language.operators.comparison.php
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23