upanotch
upanotch

Reputation: 33

How come this variable echo's as 16?

$body = "Artist: " + $artist + "Size: " + $size + "Time: " + $time + "Concept: " + $concept + "Time: " + $time + "Mod: " + $mod + "Details: " + $details;

When I try to echo this variable, all that comes out is '16.'

Can you guys help?

Upvotes: 0

Views: 42

Answers (2)

Halcyon
Halcyon

Reputation: 57703

In PHP the concatenation operator is ., not +

So:

$body = "Artist: " . $artist . "Size: " . $size . "Time: " . $time . "Concept: " . $concept ."Time: " . $time . "Mod: " . $mod . "Details: " . $details;

Upvotes: 1

John Conde
John Conde

Reputation: 219884

The concatenation operator in PHP is the . not the +

$body = "Artist: " . $artist . "Size: " . $size . "Time: " . $time . "Concept: " . $concept . "Time: " . $time . "Mod: " . $mod . "Details: " . $details;

Upvotes: 4

Related Questions