Home / PHP Tips Generated By ChatGPT / Counting the Number of Elements in an Array in PHP Determine how many elements are in an array with count(). Source Code $array = ["apple", "banana", "cherry"]; echo count($array); // Outputs: 3