Home > Backend Development > PHP Tutorial > A tragedy for php arrays? _PHP Tutorial

A tragedy for php arrays? _PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-21 15:29:52
Original
927 people have browsed it

Copy code The code is as follows:

$a=1;
$b=2;
$t = array(
array('a', 'string', $field['a']), // Name
if($a==$b){array('b','1')}
);
print_r($t);
exit;

1. Because the array is long. Didn't notice
2. The development code did not clear the cache in time. . . . The tragedy begins here
The following is the correct usage
$a==$b?array('sDesc','1'):array('sDesc','2')
Copy code The code is as follows:

$a=1;
$b=2;
$t = array(
array('a', 'string', $field['a']), // name
$a==$b?array('b','1'):array('b',' 2')
);
print_r($t);
exit;

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323351.htmlTechArticleCopy the code The code is as follows: $a=1; $b=2; $t = array( array('a ', 'string', $field['a']), // name if($a==$b){array('b','1')} ); print_r($t); exit; 1 , due to the long length of the array. No note...
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