How can the DRY (Don't Repeat Yourself) principle be applied to assigning values from an array in PHP?

When assigning values from an array in PHP, the DRY principle can be applied by using a loop to iterate over the array and assign values dynamically. This avoids repetitive code for each array element and allows for a more scalable and maintainable solution.

<?php
$array = [1, 2, 3, 4, 5];
$values = [];

foreach ($array as $value) {
    $values[] = $value;
}

print_r($values);
?>