How can I print all the values of an array?

In PHP, you can use a foreach loop to iterate through an array and print each value. Here's an example:

<?php

$my_array = [1, 2, 3, 4, 5];
foreach ($my_array as $value) {
  echo $value . "-";
}

Watch a course Learn object oriented PHP

You can also use print_r or var_dump to print all the values of an array.

<?php

$my_array = [1, 2, 3, 4, 5];
print_r($my_array);
<?php

$my_array = [1, 2, 3, 4, 5];
var_dump($my_array);

Both will give you the same result.