In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "php can query how many array elements", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "php can query how many array elements" bar!
In PHP, you can use the count () function to query how many elements are in the array. The function returns the number of array elements with the syntax "count (array, mode)"; the second parameter defaults to 0, which means that the elements in the multi-dimensional array are not calculated; if set to 1, the multi-dimensional array elements are calculated recursively.
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
Php queries how many elements there are in the array
You can query how many elements are in the array.
The count () function returns the number of elements in the array.
Grammar
Count (array,mode)
Array is required. Specifies the array to be counted.
Mode is optional. Specifies the mode of the function. Possible values:
0-default. All elements in the multidimensional array are not evaluated.
1-Recursively calculates the number of elements in the array (calculates all elements in the multidimensional array).
Return value: returns the number of elements in the array.
Examples are as follows:
The output is 3.
Thank you for reading, the above is the content of "how many array elements can be queried by php". After the study of this article, I believe you have a deeper understanding of the question of how many array elements php can query, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.