Hello Ken!,
Just thought I'd give you a heads up that the Atom Warnings throws illegal string warnings on the array using PHP 7.1 ... reverted back to PHP 7.0 and all is well.
Example of PHP 7.1 errors when running nws-alerts.php:
Warning: A non-numeric value encountered in /home/rkcrk201/public_html/nws-alerts.php on line 127
Warning: Illegal string offset 'Central Col. R. Gorge, OR' in /home/rkcrk201/public_html/nws-alerts.php on line 219
Warning: Illegal string offset 'N. OR Cascades' in /home/rkcrk201/public_html/nws-alerts.php on line 219
Warning: Illegal string offset 'S. WA Cascades' in /home/rkcrk201/public_html/nws-alerts.php on line 219
Warning: Illegal string offset 'W. Col. R. Gorge, OR' in /home/rkcrk201/public_html/nws-alerts.php on line 219
Warning: Illegal string offset 'ORZ041' in /home/rkcrk201/public_html/nws-alerts.php on line 308
Fatal error: Uncaught Error: Cannot use string offset as an array in /home/rkcrk201/public_html/nws-alerts.php:308 Stack trace: #0 {main} thrown in /home/rkcrk201/public_html/nws-alerts.php on line 308
Best Regards,
-Kevin
that is very odd. I'm still in Illinois so access to my debugging tools is limited. I did download a copy of your nws-alerts.php and it appears to match with the current version (minus one comment line).
Looking at the errors reported, the line 127 error is in
$cmyzc += substr_count($myv, '|'); // total count of codes in $myZC array
which is valid syntax for the substr_count() function.
The line 219 errors are in
$noAlrt[$nk] = $nv[0];
which should be alright if $noAlrt was previously declared to be an array(). On line 103, it is declared as a string by
$noAlrt = '';
so should probably be
$noAlrt = array();
to avoid that type conversion. Similarly:
The line 308 errors are in
$ad[$lCode][] = array($event,$urgency,$severity,$certainty,$effective,$expires,
$areaDesc,$instruction,$description,$clr,$ico,$sev,$cvk,$WA,$cvv[0],$poly,$ck);
which (again) should be ok if $ad has been previously declared to be an array() .. unfortunately, that was declared
$ad = '';
on line 101. It should likely be
$ad = array();