Posted by ZeldorBlat on 05/03/07 15:51
On May 3, 11:29 am, misiek <michal_augustyn...@gazeta.pl> wrote:
> Not sure what causes this errro..!
>
> $this->text = 'w';
> $i = 0;
> $token = '';
>
> while ($this->text{$i} != null) // <= Line #37
> {
> // some code
> $i++;
> }
>
> Uninitialized string offset: 1 in
> /home/misiek/workspace/emailpower/app/models/text_construct.php on line 37
>
> Use PHP 5.2
>
> Thanks for help
You get that error because the string only has 1 character (at index
0) so there is no character at index 1. Try this instead:
while($i < strlen($this->text)) {
//some code
$i++;
}
[Back to original message]
|