溫馨提示×

php數(shù)組長度怎么獲取

小億
91
2023-06-28 11:30:36
欄目: 編程語言

要獲取 PHP 數(shù)組的長度,可以使用 count() 函數(shù)。以下是示例代碼:

```php
$array = [1, 2, 3, 4, 5];
$length = count($array);
echo "數(shù)組的長度為: " . $length;
```

輸出結果為:

```
數(shù)組的長度為: 5
```

0