在PHP中,可以使用count()函數來計算數組元素的個數。下面是一個例子:
```php
$fruits = array("apple", "banana", "orange", "grape");
$numberOfFruits = count($fruits);
echo "There are " . $numberOfFruits . " fruits in the array.";
```
在這個例子中,count()函數會返回數組$fruits中元素的個數,然后將這個個數打印出來。