Hi all I have an array I am storing timestamps in. I then sort them using asort() and then I want to go through each one with a foreach but I get an invalid argument supplied error here is what I have:
$sorted_dates = asort($dates_to_sort);
var_dump:
array(4) { [2]=> int(1512086400) [3]=> int(1512432000) [1]=> int(1513036800) [0]=> int(1514073600) }
Foreach:
foreach ($sorted_dates as $value) {
echo "<br>".$value."<br>";
}
Error:
Warning: Invalid argument supplied for foreach()
Any idea how I can go through the array as I need to do more than echo it.