You are here: Re: Undefined offset- how to prevent warning message? « All PHP « IT news, forums, messages
Re: Undefined offset- how to prevent warning message?

Posted by Tom Peel on 09/28/11 11:41

Palle Hansen wrote:
> Tom Peel wrote:
>
>> I'm getting this message showing up in the apache error_log:
>>
>> PHP Notice: Undefined offset: 21 in
>> /usr/local/apache2/htdocs/cargo/lpdriver.php on line 104
>> The offending code line is:
>>
>> $constraintuno[$k] .= $s." + ";
>>
>> This is inside a loop where $k is integer and being being incremented
>> on each iteration.
>
>
>
> $constraintuno[$k] .= $s." + ";
>
> is the same as
>
> $constraintuno[$k] = $constraintuno[$k] . $s." + ";
>
> so you could try and remove the dot before =
>
> $constraintuno[$k] = $s." + ";
I guess you mean
$constraintuno[$k] = $constraintuno[$k] . $s." + ";

but that makes no difference.

T.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация