WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: mkutche on February 04, 2019, 07:17:43 AM
-
any idea how to fix this??
Notice: Undefined offset: 1 in /home/hj2ke8lfpx43/public_html/forecast-summary.php on line 138
Notice: Undefined offset: 1 in /home/hj2ke8lfpx43/public_html/forecast-summary.php on line 140
here's line 138 and 140
$discussion = $matches[1]; // now have the forecast as a string with \n delimiters
$discussion = trim($matches[1]); // prevent extra white space at beginning and end
Thanks,
Mike
-
That undefined is caused by failure of the prior statement
preg_match('|<pre[^>]*>(.*)</pre>|Usi',$html,$matches);
It's likely due to an incomplete page fetch from the NWS site, so the area with a forecast discussion wasn't found.
-
That undefined is caused by failure of the prior statement preg_match('|<pre[^>]*>(.*)</pre>|Usi',$html,$matches);
It's likely due to an incomplete page fetch from the NWS site, so the area with a forecast discussion wasn't found.
Can I hide the error??
-
Sure.. best thing to do is to turn off Notice: errata from display.
In your php.ini just put:
error_reporting = E_ALL & ~E_NOTICE
-
Sure.. best thing to do is to turn off Notice: errata from display.
In your php.ini just put:
error_reporting = E_ALL & ~E_NOTICE
i put that and it still shows errors hm :(