I want to write the following code in ternary operator. I tried in many way but it does not work at all.
<?php
if(isset($options['footer_txt_color'])) {
echo $options['footer_txt_color'];
} else {
echo "#ffffff";
}
?>
Use this code
echo (isset($options['footer_txt_color'])) ? $options['footer_txt_color'] : '#ffffff';
It should be like this:
<?php echo (isset($options['footer_txt_color'])) ? $options['footer_txt_color'] : "#ffffff"; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With