I have the following problem on my website, when I check the file "error_log" this em shows the following error:
"Invalid argument supplied for foreach () in / home / ..."
This is in the error location:
<?php
foreach ($on['result'] as $val) { ?>
<a href="#" onClick="goToProfile(<?= $val['id'];?>)"><li class="chat__human" style="margin-bottom: 5px;">
<img class="chat__avatar" style="padding: 1px;margin:3px" src="<?= $val['photo'];?>" alt="" />
<span class="chat__name comforta" style="position: absolute;margin-left:5px;margin-top: 5px;font-weight: bold"><?= $val['firstName'];?></span>
<span class="chat__last_m" style="position: absolute;margin-left:5px;margin-top: 23px;color:#999"> <?= $val['last_m'];?></span>
</li></a>
<?php } ?>
I hope you can help me solve this error, thank you.