Re: muli-variable variables ? (something like that)
| From: | Philip Olson | Date: | Wed, 08 May 2002 21:21:29 +0000 |
| Subject: | Re: muli-variable variables ? (something like that) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96677@lists.php.net to get a copy of this message | ||
> Hmmm i knew most of that stuff except that you were supposed
> to use $foo{3} syntax to get the character. I've been using
> $foo[3] syntax to get a character... should that work the way
> it does?
>
> $foo = 'yaaaaaay';
> echo ($foo{0} === $foo[0] ? 'Same!' : 'Different!')."\n";
$foo{0} is preferred and was introducted in PHP4. $foo[0]
still works but is deprecated, so maybe one day it won't work.
Regards,
Philip Olson