I have a minor website for publishing photos, located at www.jondanielsson.com. My knowledge in PHP, HMTL and websites is minimal. I manage to update the website with new photos and picture series, but that is basically it.
The website was coded by an old friend of mine back in 2012, so the php version would be 5.4 or older. Seeing as the web-hotel where the site is stored is moving to php 7.x and do not support older versions anymore I have run into some problems.
PHP error message on website:
Fatal error: Uncaught Error: [] operator not supported for strings in /customers/4/c/c/jondanielsson.com/httpd.www/index.php:27 Stack trace: #0 {main} thrown in /customers/4/c/c/jondanielsson.com/httpd.www/index.php on line 27
This could also be line 30 or 31 depending on the root location.
On the lines resulting an error the following code is:
foreach($images as $image){ $imgs[] = “$image”; }
Formula foreach ($series as $serie) { works as intended.
Any guidance to give on how to alter the foreach code line to get it working as intended? I have referenced below sites, without really figuring out how the foreach can be fixed between versions:
https://www.php.net/manual/en/control-structures.foreach.php
https://www.php.net/manual/en/migration70.incompatible.php
Huge thanks for the support and please let me know if any additional information would be needed.