Reply to Re: strings and {...}

Your name:

Reply:


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'.

[Back to original 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

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