say*_*ful 5 php ternary operator-keyword
我想在三元运算符中编写以下代码。我尝试了很多方法,但是根本没有用。
<?php
if(isset($options['footer_txt_color'])) {
echo $options['footer_txt_color'];
} else {
echo "#ffffff";
}
?>
Run Code Online (Sandbox Code Playgroud)
Sun*_*gia 13
使用此代码
echo (isset($options['footer_txt_color'])) ? $options['footer_txt_color'] : '#ffffff';
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12688 次 |
| 最近记录: |