In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you what the php count string returns, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The php count string returns "1". Reason: count () is an array method that returns the number of elements in the array; when calculating "count", the string is converted to an array with only one element, and then the number of elements in the array is counted and returned, thus returning the value "1".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
What does the php count string return?
Let's take a look at the code:
The run result is 1, so the count string returns a numeric value of "1".
Reason: automatic type conversion occurred
Count () is an array method that returns the number of elements in the array.
When you use the count () function to calculate the length of a string, the system automatically converts the string to an array array ("hello") with only one element, and then calculates it.
/ / equivalent to echo count (array ("hello"))
So count (string) returns a value of 1.
What are the characteristics of php 1, the execution speed is fast. 2. It has good openness and expansibility. 3. PHP supports a variety of mainstream and non-mainstream databases. Object-oriented programming: PHP provides classes and objects. 5. The update speed of the version is fast. 6. It has rich functions. 7. Scalability. 8. Comprehensive functions, including graphics processing, encoding and decoding, compressed file processing, xml analysis and so on.
The above is what the php count string returns. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.