加速你的php数组_PHP教程

WBOY
Release: 2016-07-12 09:08:16
Original
1021 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 可以这么写 这样一来 速度必然提上去

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1056014.htmlTechArticle加速你的php数组 有个二维数组 $g=array(foo=array(bar=1 ),); 如果要访问到bar的值 传统需要这样访问 $g[foo][bar] 但是换个思路 可以如下访问 $g[fo...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!