PHP Basics : Comparison operators

PHP comparison operators aren’t that much different from comparison operators in any other language but can be a cause of issues for new users due to the script comparison as well as the difference between equal and identical.

Let’s look at some basic comparison operators.

$a = 10;var_dump($a == 10);
var_dump($a == '10');

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store