RSS

Forum | Difference between = and == ?

You must be logged in to post
Search Forums:


 






Difference between = and == ?

UserPost

2:12 PM
May 9, 2010


JeremyD

Member

posts 6

1

I've been so detatched from web development lately that it's not funny and I figured it was a good time to get into PHP finally. I know everything I've re-learned so far, but the w3schools tutorials will hopefully push me into some foreign territory. Anyway, I was messing around with elseif and discovered that ==, but not , works when comparing a variable to a number.

So I'm wondering what's the difference between = and ==? is == for comparing variables while = is for numeric stuff and defining variables?


Also, a google search for that is useless… lol

1:09 PM
May 11, 2010


tomw

Member

posts 74

2

PHP.net should provide good write up. Have a look and see if this help:

http://php.net/manual/en/langu…..arison.php