Re: Undefined Offset Error
| From: | Richard Lynch | Date: | Tue, 02 Jul 2002 22:28:59 +0000 |
| Subject: | Re: Undefined Offset Error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105079@lists.php.net to get a copy of this message | ||
>Here is a piece of my code...
>Could someone tell me what I did wrong? I get the following errors;
>
>Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on
>line 33
>Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on
>line 34
>
>(obviously, the line numers will not be the same here)
Be nice if you told us which lines *where* 33 and 34 then...
Especially since I don't think your posted code even includes those
lines... :-)
Basically, you are doing something like:
$foo[0] = 'test';
echo $foo[1];
Or, perhaps:
$foo = 't';
echo $foo[1];
In either case, the array/string has *NO* element at position 1, and you are
trying to do something with it. Don't.
--
Like Music? http://l-i-e.com/artists.htm