HEELPBOOK - PHP - = vs. == vs. === ####################### Assignment Operator = A single equal sign = is the basic assignment operator in PHP. Don't think this sign as "equal to". The variable on left side of = gets set to the value of the expression on the rights. It is used to set a variable equal to a value or set a variable to another variable's value. ########## Example = In above example $a and $b has the same value 123. Equal Operator == The double equal sign == is a comparison operator called Equal Operator, it accepts two inputs to compare and return true if the values are same and return false if values are not same. Keep in mind that the equality operator == is different than the assignment operator =. The assignment operator changes the variable on the left to have a new value, while the equal operator == tests for equality and returns true or false. ########### Example == The above example prints Values are same. ########### Identical Operator === Identical operator === allows for stricter comparison between variables. It only returns true if the two variables or values being compared hold the same information and are of the same data type. Example === The above example prints values and types are not same because $a data type is an integer and $b data type is string, and these data types are not same, === compares two things values and type, failure in one returns the false result. Note alway remember that Equal and Identical operators are not the same thing. Identical matches both a variable's value and datatype, whereas Equal matches only value. ############ ARTICLE INFO ############# Article Month: November Article Date: 07/11/2012 Permalink: http://heelpbook.altervista.org/2012/php-vs-vs/ Source: http://sourcedaddy.com/php/differentiate-equal-signs.html Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook Linkedin: http://it.linkedin.com/pub/stefano-maggi/27/73a/b20 Google+ : https://plus.google.com/116990277568167008289/posts