say*_*ful 5 php ternary operator-keyword
我想在三元运算符中编写以下代码。我尝试了很多方法,但是根本没有用。
<?php 
if(isset($options['footer_txt_color'])) {
    echo $options['footer_txt_color'];
} else {
    echo "#ffffff";
}
?>
Sun*_*gia 13
使用此代码
echo (isset($options['footer_txt_color'])) ? $options['footer_txt_color'] : '#ffffff';