Page 1 of 1

Appending strings

Posted: Wed Jun 23, 2004 12:20 am
by jdizzle
How do I append strings that contain numbers for their values?

Posted: Wed Jun 23, 2004 12:32 am
by Illusionist

Code: Select all

$num = 15;
$text = "Number is: ";
$text = $text . $num;  //or $text .= $num
echo $text; //returns Number is: 15
I think this is what your asking....

Posted: Wed Jun 23, 2004 12:32 am
by feyd
the concatenation operator: . (period)

example:

Code: Select all

<?php

$foo = 123;
$bar = 'jerry';

$baf = $foo.$bar;

echo $baf;

?>