Home > Backend Development > PHP Tutorial > php 数组的一个悲剧?_php技巧

php 数组的一个悲剧?_php技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-17 09:19:29
Original
944 people have browsed it
复制代码 代码如下:

$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;
Related labels:
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template