Re: Offset error
| From: | Justin Patrin | Date: | Fri, 16 Jul 2004 00:00:14 +0000 |
| Subject: | Re: Offset error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190654@lists.php.net to get a copy of this message | ||
if(isset($att[$k]->parameters[1])) {
//use $att[$k]->parameters[1]->value
}
or, assuming indexes start at 0 and are sequential:
if(count($att[$k]->parameters) > 1) {
//use $att[$k]->parameters[1]->value
}
On Thu, 15 Jul 2004 17:08:16 -0600, C.F. Scheidecker Antunes
<nando@antunes.eti.br> wrote:
> Hello,
>
> error: PHP Notice: Undefined offset: 1 in
> /home/ant/test.app/teste3/getfiles.php on line 217
>
> I have this Undefined offset error in PHP because I am trying to get a
> value from this $att[$k]->parameters[1]->value that sometimes does not
> exist with offset 1 as the parameters go up to 0 and not one.
>
> Can anyone tell me how to test the offset 1 or more in the array
> $att[$k]->parameters[1] so that I can avoid this error?
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> !DSPAM:40f70d90273879057181623!
>
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--