Posted by luke on 10/13/67 11:19
Not wanting to repeat what has been written, but I think someone should
point out that the concatenation of global variables has to be done with the
.. (dot) operator, whereas using local variables, like you have, you can
directly stick strings together _or_ use the . operator.
So these are all ok:
$bigstring = "$first $second";
$bigstring = "$first some non variable text $second";
$bigstring = $first . $second;
$bigstring = $first . " some non variable text " . $second;
But with globals only . concatenation is ok:
$bigstring = $_POST['Name'] . $_POST['Email'];
$bigstring = "normal text with $localvariable" . $_POST['Name'] . "more
text";
(above code has not been tested in real-life) :>
Luke
"Desmond" <pd_otoole@hotmail.com> wrote in message
news:1119282029.932162.16230@f14g2000cwb.googlegroups.com...
> Can someone please tell me how to concatanate to strings like this
> please
>
>
> $name = $_POST["Name"];
> $from = $_POST["Email"];
>
> $headers = "From: $name $from\r\n";
>
> i beleve in C there is a strcat() is this similar.
> if so is there an online site for PHP function.
>
> Desmond.
>
[Back to original message]
|