Home  >  Article  >  Backend Development  >  PHP array_push 数组函数_PHP

PHP array_push 数组函数_PHP

WBOY
WBOYOriginal
2016-06-01 12:22:29791browse

1.
$arr = array();
$arr[] = '';
2.
$arr = array();
array_push($arr,'');

刚做一个100000次的循环插入,结果还是第一种要快一些!(循环插入数字,100000次,第一种0.04左右,第二种0.08秒左右)

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