You mean $string{2} ? That's the more correct way to do $string[2] to
make it clear that it is a character offset. This has been supported for
years and will not go away.
-Rasmus
On Tue, 10 Dec 2002, Brad Bulger wrote:
>
> trying to fix bugs in some PEAR code, i noticed the person used a way
> of getting at the individual characters in a string:
>
> $string{2} === substr($string,2,1)
>
> is that old syntax or something? is there any reason to expect it to work
> in future versions?
>
> thanks
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php