Forum Moderators: coopster

Message Too Old, No Replies

Merge variables

         

Habtom

8:16 am on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Please tell me if there is a function to merge to variables holding text.

Habtom

omoutop

8:48 am on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



$var1 = "this is a variable holding text";
$var2 = "another variable holding text";

$var3 = $var1." - ".$var2;

echo $var3
// will output
// this is a variable holding text - another variable holding text

coopster

12:18 pm on Apr 4, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



... and it is called "concatenation". You can read more about it in the PHP String Operators [php.net] pages.

Habtom

12:43 pm on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your response.

I was wondering if there is a function like array_merge for merging variables.

Habtom

eeek

12:58 pm on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



was wondering if there is a function like array_merge for merging variables.

Perhaps you should define what you mean by merging valiables.