PDA

View Full Version : Combining Variables [PHP]



Digitalosophy
July 25th, 2003, 07:53 PM
Hiya, sorry to ask such a silly question, but as many know my php knowledge is kinda slim

How do i combine several variables to send in my mail object?



$name = $_GET['name'];
$address = $_GET['address'];
$city = $_GET['city'];
$apt = $_GET['apt'];
$state = $_GET['state'];
$zip = $_GET['zip'];


I don't know why I just can't say



$myVar = $name, $address, etc ;


I tried numerous ways of doing this and just can't get it right

Tanks!

ahmed
July 25th, 2003, 07:57 PM
you can say this:
$myVar = "$name, $address";

Digitalosophy
July 25th, 2003, 08:13 PM
omg so because i didn't have " ", that's why? lol thanks man:)

nobody
July 25th, 2003, 08:23 PM
Yeah "s in PHP seriously suck..

ahmed
July 25th, 2003, 08:35 PM
no they don't. in flash, you would have to go like
myVar = name+", "+address+", etc.."; which does suck =)

nobody
July 25th, 2003, 08:38 PM
Well I always manage to completely misplace them or forget one or something and they bug me.

λ
July 26th, 2003, 05:27 AM
The most annoying thing I find about PHP is it uses . for string concatenation, instead of the + used in Flash.

Now when I'm working mainly with PHP, I find myself using +, and when I'm working in Flash I find myself writing . :trout: