Jump to content

Concatenation of an array


chuy08

Recommended Posts

given the following array:

$sql['city'] = 'Fremont';
$sql['state']= "CA";
$sql['zip'] = "94538"

how would you concatenate these array variables to appear as follows:

Fremont, CA  94538

I have tried the following:

$faddress = ($sql['city'].$sql['state'].$sql['zip']);
print $faddress;

But this returns

FremontCA94538

How do I add spaces to this array concatenation?
Link to comment
https://forums.phpfreaks.com/topic/26384-concatenation-of-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.