Set variable to value of other variables.

	  $fname = $_POST['fname'];
	  $lname = $_POST['lname'];
	  $street = $_POST['street'];
	  $city = $_POST['city'];

How can I make $mailing address = all of the above?

$mailingaddress = $fname & $lname & $street & $city;

Hi there,

Do the following:

[php]$mailingaddress = $fname.$lname.$street.$city;[/php]

To add spaces in between:

[php]$mailingaddress = $fname.’ ‘.$lname.’ ‘.$street.’ '.$city;[/php]

Hope this helps.

Perfect! Thank you! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service