The following provides two PHP codes that determine whether the array is empty. Because the array is a composite data type, we cannot process it like other character data. See examples below.
Method
1. Use count (array) to get records. Empty returns 0
2. Use is_null function
The code is as follows
|
Copy code
|
||||
$a=array('1','2','3');
echo count($a);
Previous article:Convert datetime type date and time to Chinese representation_PHP tutorial
Next article:Image verification code generation application example_PHP tutorial
Statement of this Website
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
Latest Articles by Author
Latest Issues
When adding sublime3 to compile system php, use the PHP toolbox, cmd php -v is useless
From 1970-01-01 08:00:00
0
0
0
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|