Page 1 of 1

Quick Question

Posted: Sat Sep 26, 2009 12:18 am
by linewire
I've been PHPin for quite some time now, but I never could find what the difference was between:
$var = "hello";
and
"hello" => $var // I think that's how I've seen it

What's the diff? thanks ; )

Re: Quick Question

Posted: Sat Sep 26, 2009 12:50 am
by requinix
The first is just vanilla assignment of something to a variable.

The second is only for associative arrays (the key isn't just an automatically-incremented number).