【发布时间】:2020-04-01 22:36:35
【问题描述】:
我想做这样的事情:
array(
if($condition = "xyz") { array('value' => $a, 'text' => $a), }
array('value' => $b, 'text' => $b),
...
);
但它不允许我在那个数组函数中拥有那个 if 函数?我做错了什么?有没有办法让它成为可能? 提前致谢!
【问题讨论】:
标签: php arrays function if-statement