Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6368
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: Using count() as an array index |
| Date | Mon, 18 Jun 2012 19:43:56 +0200 |
| Organization | A noiseless patient Spider |
| Lines | 47 |
| Message-ID | <4FDF68DC.4050707@arnowelzel.de> (permalink) |
| References | <jrg08j$ldn$1@dont-email.me> <jrgab8$n9j$1@dont-email.me> <jrihcn$7ht$1@dont-email.me> <jrik64$ovm$1@dont-email.me> <4FDEDCC7.4010002@arnowelzel.de> <jrn04n$dt2$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252 |
| Content-Transfer-Encoding | 7bit |
| Injection-Info | mx04.eternal-september.org; posting-host="uO9Sccelu4tfD+GMr79Efw"; logging-data="12970"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18D6l17iIKZFkKdjq40aTQNgO/mryoJICA=" |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
| In-Reply-To | <jrn04n$dt2$1@dont-email.me> |
| Cancel-Lock | sha1:fQHTF4SemINHxozsIhn+E4zXepU= |
| Xref | csiph.com comp.lang.php:6368 |
Show key headers only | View raw
Norman Peelman, 18.06.2012 12:32:
> On 06/18/2012 03:46 AM, Arno Welzel wrote:
>> Jerry Stuckle, 16.06.2012 20:44:
[...]
>> "{$anArray[count($anArray)]}\n";
[...]
>> Just because something is possible does not mean you have to use it ;-)
>> Curly braces should only be used for code blocks and not to replace
>> string concatenation.
>>
>
> It's a little more than possible... it was designed this way. It's not
> a replacement for string concatenation, it is used (in this context) for
It is.
The form
"text {...something...} text"
is generally the same as
'text' . something . 'text'
> variable expansion within strings. If you don't want to use curly brace
> syntax, then do it the long way, it's your choice. Me personally, I find
> curly brace syntax much more readable than alot of '.'s and '/' escapes
> like alot of people use.
So:
echo 'This is the result: '.$myclass->result;
Is longer than
echo "This is the result: {$myclass->result}";
And why do i have to escape '/'? Seems have missed something ;-)
--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-15 12:51 -0600
Re: Using count() as an array index Gregor Kofler <usenet@gregorkofler.com> - 2012-06-15 21:04 +0200
Re: Using count() as an array index Denis McMahon <denismfmcmahon@gmail.com> - 2012-06-15 21:38 +0000
Re: Using count() as an array index Chuck Anderson <cycletourist@invalid.invalid> - 2012-06-15 15:44 -0600
Re: Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-16 11:56 -0600
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-16 14:44 -0400
Re: Using count() as an array index Scott Johnson <noonehome@chalupasworld.com> - 2012-06-16 14:43 -0700
Re: Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-17 07:57 -0600
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-17 10:27 -0400
Re: Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-18 08:46 -0600
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-18 13:38 -0400
Re: Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-19 09:03 -0600
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-19 11:27 -0400
Re: Using count() as an array index Arno Welzel <usenet@arnowelzel.de> - 2012-06-18 09:46 +0200
Re: Using count() as an array index Norman Peelman <npeelmandog@cfl.rr.com> - 2012-06-18 06:32 -0400
Re: Using count() as an array index The Natural Philosopher <tnp@invalid.invalid> - 2012-06-18 12:24 +0100
Re: Using count() as an array index Arno Welzel <usenet@arnowelzel.de> - 2012-06-18 19:43 +0200
Re: Using count() as an array index "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-06-19 09:31 +0200
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-18 08:43 -0400
Re: Using count() as an array index Christoph Becker <cmbecker69@gmx.de> - 2012-06-19 13:24 +0200
Re: Using count() as an array index Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-19 07:39 -0400
Re: Using count() as an array index Christoph Becker <cmbecker69@gmx.de> - 2012-06-19 15:04 +0200
Re: Using count() as an array index Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-06-19 09:14 -0600
csiph-web