You are here: Re: concatanate 2 strings « PHP Programming Language « IT news, forums, messages
Re: concatanate 2 strings

Posted by Kimmo Laine on 06/20/05 19:45

"Desmond" <pd_otoole@hotmail.com> kirjoitti
viestissδ:1119284581.016755.16170@o13g2000cwo.googlegroups.com...
> Thanks I have seen some code on the internet and it uses a full stop
>
> $aaa . $bbb

That works too.

> and I have seen $zzz .= $vvvv is the .= rthe equivelent as +=

That also works.

Full stop is the concatenation operator, but php also has the quite unique
mechanism for inserting variables directly into strings.

$foo .= $bar;
is just short for
$foo = $foo . $bar; and they both concatenate the two variables.
But this works as well, just in a slightly different way:
$foo = "$foo$bar";

Variables inside double qoutes are replaced with their values. inside single
qoutes they'r not evaluated, but interpreted literally.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com

 

Navigation:

[Reply to this 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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация