Home >Backend Development >PHP Tutorial >php 数组的一个悲剧?_PHP

php 数组的一个悲剧?_PHP

WBOY
WBOYOriginal
2016-06-01 12:16:43815browse
复制代码 代码如下:
$a=1;
$b=2;
$t = array(
array('a', 'string', $field['a']), // 名称
if($a==$b){array('b','1')}
);
print_r($t);
exit;

1、由于数组篇幅较长。没注意到
2、开发代码没及时清理缓存。。。。悲剧就是从这里开始
下面是正确的用法
$a==$b?array('sDesc','1'):array('sDesc','2')
复制代码 代码如下:
$a=1;
$b=2;
$t = array(
array('a', 'string', $field['a']), // 名称
$a==$b?array('b','1'):array('b','2')
);
print_r($t);
exit;
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn