PHP: Check if Array is Empty
You can use the following code to check if an array is empty:
if(empty($array)) {
echo "数组为空";
} else {
echo "数组不为空";
}
The empty() function, in the code above, is used to determine if an array is empty. It returns true if the array is empty, and false if it is not. You can use the return value to determine if the array is empty.