PHP 多个 if else shorthand 错误

PHP multiple if else shorthand error

$array['something'] ? $a ?$b ? $c : '';

3 var里面有一个有值,给数组赋值,但是不行

尝试这样的事情:

$array['something'] = (($a) ? $a : (($b) ? $b : (($c) ? $c : '')));

您在找这样的东西吗?

$array['something'] = !empty($a) ? $a : (!empty($b) ? $b : (!empty($c) ? $c : ""));

$a$b$c 中只有一个有值,只分配那个值