Quick Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
linewire
Forum Newbie
Posts: 3
Joined: Sat Sep 26, 2009 12:16 am
Location: WA

Quick Question

Post 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 ; )
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Quick Question

Post 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).
Post Reply