Posted by ZeldorBlat on 09/07/05 19:56
> SELECT * FROM table1 WHERE col1 = {0} AND col2 = {1};
Umm...that's SQL, not PHP. However, PHP does use curly braces for
things other than blocks of code:
http://www.php.net/manual/en/language.types.string.php
One thing they can be used for is addressing strings as if they were
arrays. The number inside the {} indicates which character
(zero-indexed) you want to get at. So:
$s = 'Hello';
$s{0} = 'f';
echo $s;
will output 'fello'.
Navigation:
[Reply to this message]
|