Difference between array_push() and $array[] =

前端 未结 9 2029
梦毁少年i
梦毁少年i 2020-12-02 07:06

In the PHP manual, (array_push) says..

If you use array_push() to add one element to the array it\'s better to use $array[]

9条回答
  •  不思量自难忘°
    2020-12-02 07:40

    both are the same, but array_push makes a loop in it's parameter which is an array and perform $array[]=$element

提交回复
热议问题