I am trying to solve a Invalid argument supplied for foreach() warning. I am 99% certain that this is related to the version of PHP running on our server, but for the moment that can't be changed, so I am looking to "fix" the code instead.
The code snippet:
$array = $this->cal;
$events = $array['VEVENT'];
foreach ($array['VEVENT'] as $anEvent) {
I am getting the Invalid warning on the foreach statement. It works fine on a PHP 5.4 server, but when moved to a 5.3 server, I have the problem. How can I "downgrade" the code? I have been beating my head against the screen digging through all the different comments, but can't figure out the solution. The code was provided by a sub-contracted developer who is now unreachable, so...
Appreciate the help and education...