How can you efficiently loop through an array multiple times in PHP?

When looping through an array multiple times in PHP, it is important to reset the internal array pointer back to the beginning after each iteration. This can be achieved by using the `reset()` function to reset the array pointer to the first element before starting each loop iteration. By doing this, you can efficiently loop through the array multiple times without needing to create a new array or duplicate the data.

// Example array
$array = [1, 2, 3, 4, 5];

// Loop through the array multiple times
for ($i = 0; $i < 3; $i++) {
    reset($array); // Reset the array pointer to the beginning
    foreach ($array as $value) {
        echo $value . " ";
    }
    echo "\n";
}