Input
Output
<?php // Define an array $numbers = array(12, 45, 78, 34, 89, 23, 67); // Initialize max with the first element $max = $numbers[0]; // Traverse the array to find the maximum for ($i = 1; $i < count($numbers); $i++) { if ($numbers[$i] > $max) { $max = $numbers[$i]; } } // Display the maximum element echo "The maximum element in the array is: $max"; ?>