Re: Hide the undefined offset error for the array?
| From: | Rasmus Lerdorf | Date: | Tue, 30 Jul 2002 16:06:33 +0000 |
| Subject: | Re: Hide the undefined offset error for the array? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110360@lists.php.net to get a copy of this message | ||
Your default error reporting level must be set different on your Windows
box. If you turn off E_NOTICE warnings on your Windows box it will act
the same as your Linux box.
But, in general, to write E_ALL clean code you would check if each exists
first, or swallow the errors if you know that these indices may not be
present using something like this:
if (@$raw_data[$num_count] != @$match_array[$x]) {
-Rasmus
On Tue, 30 Jul 2002, Scott Fletcher wrote:
> I have one of the website on windows and I get the undefined offset error, I
> don't have that problem on UNIX / Linux. Anyone know what method would
> work?? Here's the script! In this case, the $raw_data array is empty, so
> window complain of the empty data by displaying hte error message,
> "Undefined offset ........".
>
> --clip--
> if ($raw_data[$num_count] != $match_array[$x]) {
> --clip--
>
> Thanks!
> FletchSOD
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>