In PHP, how do I iterate over arrays with examples?

In PHP, you can iterate over an array using several methods, including the `foreach` loop, the `for` loop, and the `while` loop. Below are examples of how to use each method.

Keywords: PHP, iterate, array, foreach, for loop, while loop
Description: This section demonstrates how to iterate over arrays in PHP using different looping techniques.

";
}

// Example of using for loop to iterate over an array
for ($i = 0; $i < count($fruits); $i++) {
    echo $fruits[$i] . "
"; } // Example of using while loop to iterate over an array $i = 0; while ($i < count($fruits)) { echo $fruits[$i] . "
"; $i++; } ?>

Keywords: PHP iterate array foreach for loop while loop