"/> ">

Home  >  Article  >  Backend Development  >  Get the length of an array - count() function

Get the length of an array - count() function

巴扎黑
巴扎黑Original
2016-11-12 09:48:421547browse


Get the length of the array - count() function

count() function is used to return the length of the array (number of elements):

Example

<?php
$cars=array("Volvo","BMW","SAAB");
echo count($cars);
?>


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