1.
$arr = array();
$arr[] = '';
2.
$arr = array();
array_push($arr,'');
Just did a 100000 times loop insertion, The result is that the first one is faster! (Loop to insert numbers, 100,000 times, the first type is about 0.04 seconds, the second type is about 0.08 seconds)
The above introduces the array_push PHP array_push array function, including the content of array_push. I hope it will be helpful to friends who are interested in PHP tutorials.