Home > php教程 > php手册 > body text

加速你的php数组

WBOY
Release: 2016-06-13 08:54:21
Original
782 people have browsed it

加速你的php数组

有个二维数组

 

$g=array(
'foo'=>array(
'bar'=>1  

),


);
Copy after login

 

 

如果要访问到bar的值 传统需要这样访问 

 

$g['foo']['bar']

 

但是换个思路 可以如下访问

 

$g['foo.bar'] 或则 $g['foo_bar']

等等各种形式 由此可以扩展到三维数组 

甚至js 可以这么写 这样一来 速度必然提上去

Related labels:
source:php.cn
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template