要獲取 PHP 數組的長度,可以使用 count() 函數。以下是示例代碼:```php$array = [1, 2, 3, 4, 5];$length = count($array);echo "數組的長度為: " . $length;```輸出結果為:```數組的長度為: 5```