Home > Backend Development > PHP Tutorial > PHP array_push array function_PHP tutorial

PHP array_push array function_PHP tutorial

WBOY
Release: 2016-07-21 15:41:56
Original
1175 people have browsed it

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

I just did a 100,000-time loop insertion, and the result is that the first method is still faster! (Inserting numbers in a loop, 100,000 times, the first type is about 0.04 seconds, the second type is about 0.08 seconds)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321081.htmlTechArticle1. $arr = array(); $arr[] = ''; 2. $arr = array( ); array_push($arr,''); I just did a 100,000-time loop insertion, and the result is that the first method is faster! (Loop to insert numbers, 100,000 times,...
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