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 video course
Learn object oriented PHP
You can also use print_r or var_dump to print all the values of an array.
Both will give you the same result.