PHP array: count or sizeof?

后端 未结 8 917
慢半拍i
慢半拍i 2020-11-30 21:27

To find the number of elements in a PHP $array, which is faster/better/stronger?

count($array) or sizeof($array) ?

Ed

8条回答
  •  不知归路
    2020-11-30 22:09

    sizeof() is just an alias of count() as mentioned here

    http://php.net/manual/en/function.sizeof.php

提交回复
热议问题