Re: concatenating with "." or ","

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nitsan Bin-Nun wrote:
Gosh, what a smart ass!
The comma can also concatenate string!
You may want to run the following lines:
<?php
$a = 3;
$b = 5;
echo $a, "abc", $b;
?>

Regards, (I'm actually crying right now for guys like who showoff too
much..)

Erm, I wasn't being a smart ass was I? Certainly didn't mean to be. I was aiming for some light humoured banter as is the style on this list. Sometimes I miss that target, and sometimes my comments are just soooo witty and clever than no-one gets them ;)

Incidentally, despite your bold claims that I'm at fault, you are actually wrong.

The comma here is simply separating the arguments passed to echo (which isn't really a function, more a language construct as it does not need the parenthesis required by a normal function call).

Your output will all appear (and thus it seems like concatenation) but there is no actual concatenation going on. You are simply passing in multiple arguments, all of which are output in order.

Col (who is crying for the guys who like to showoff when they think someone else has made a mistake but it actually backfires and blows up in their face)

--

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux