Input
Output
<?php // Define an array $numbers = array(12, 45, 78, 34, 89, 23, 67); // Define the target element to search $target = 34; $found = false; // Perform linear search for ($i = 0; $i < count($numbers); $i++) { if ($numbers[$i] == $target) { echo "Element $target found at index: $i"; $found = true; break; } } if (!$found) { echo "Element $target not found in the array."; } ?>