<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FComparison-Operators_%2FEnglish</id>
		<title>PHP-and-MySQL/C2/Comparison-Operators /English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FComparison-Operators_%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Comparison-Operators_/English&amp;action=history"/>
		<updated>2026-04-08T20:00:26Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Comparison-Operators_/English&amp;diff=525&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Time !Narration |- |0:00 |In this PHP tutorial we will learn about Comparison Operators. |- |0:04 |Comparison Operators can compare 2 values, 2 strings or 2 variable…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Comparison-Operators_/English&amp;diff=525&amp;oldid=prev"/>
				<updated>2012-11-29T06:31:54Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Time !Narration |- |0:00 |In this PHP tutorial we will learn about Comparison Operators. |- |0:04 |Comparison Operators can compare 2 values, 2 strings or 2 variable…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Time&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|0:00&lt;br /&gt;
|In this PHP tutorial we will learn about Comparison Operators.&lt;br /&gt;
|-&lt;br /&gt;
|0:04&lt;br /&gt;
|Comparison Operators can compare 2 values, 2 strings or 2 variables that can contain any of them and will act upon that.&lt;br /&gt;
|-&lt;br /&gt;
|0:12&lt;br /&gt;
|For this I am going to use an IF statement.&lt;br /&gt;
|-&lt;br /&gt;
|0:19&lt;br /&gt;
|Lets start by creating the IF statement structure.&lt;br /&gt;
|-&lt;br /&gt;
|0:30&lt;br /&gt;
|My condition is if 1==1.&lt;br /&gt;
|-&lt;br /&gt;
|0:33&lt;br /&gt;
|echo.&lt;br /&gt;
|-&lt;br /&gt;
|0:36&lt;br /&gt;
|True.&lt;br /&gt;
|-&lt;br /&gt;
|0:39&lt;br /&gt;
|and then else.&lt;br /&gt;
|-&lt;br /&gt;
|0:43&lt;br /&gt;
|echo.&lt;br /&gt;
|-&lt;br /&gt;
|0:46&lt;br /&gt;
|False. Remember I don't need these brackets so I'm going to take them out.&lt;br /&gt;
|-&lt;br /&gt;
|0:51&lt;br /&gt;
|Lets indent it&lt;br /&gt;
|-&lt;br /&gt;
|0:53&lt;br /&gt;
|Never mind the indenting.&lt;br /&gt;
|-&lt;br /&gt;
|0:58&lt;br /&gt;
|This is the first comparison operator.&lt;br /&gt;
|-&lt;br /&gt;
|1:02&lt;br /&gt;
|2 = to means comparison operator.  We've seen this in the IF statement before.&lt;br /&gt;
|-&lt;br /&gt;
|1:06&lt;br /&gt;
|1 does equal to 1 so this will echo True. Lets try it.&lt;br /&gt;
|-&lt;br /&gt;
|1:11&lt;br /&gt;
|We got True.&lt;br /&gt;
|-&lt;br /&gt;
|1:13&lt;br /&gt;
|Let me change this.  IF 1 is greater than 1 then lets see what result we get.&lt;br /&gt;
|-&lt;br /&gt;
|1:27&lt;br /&gt;
|False, because 1 is equal to 1 and not greater than 1.&lt;br /&gt;
|-&lt;br /&gt;
|1:33&lt;br /&gt;
|Now lets change this to 1 greater than or equal to 1&lt;br /&gt;
|-&lt;br /&gt;
|1:36&lt;br /&gt;
|IF 1 greater than or equal to 1, echo True otherwise echo False.&lt;br /&gt;
|-&lt;br /&gt;
|1:43&lt;br /&gt;
|Here we should get True.&lt;br /&gt;
|-&lt;br /&gt;
|1:48&lt;br /&gt;
|You can also do the same with less than or equal to. So for example less than&lt;br /&gt;
|-&lt;br /&gt;
|1:55&lt;br /&gt;
|would be False, less than or equal to would be True.&lt;br /&gt;
|-&lt;br /&gt;
|2:01&lt;br /&gt;
|We can also say not equal.  So if 1 is not equal to 1 echo True&lt;br /&gt;
|-&lt;br /&gt;
|2:12&lt;br /&gt;
|Refresh.  We'll get False here because 1 is equal to 1. Now lets say if 1 isn't equal to 2&lt;br /&gt;
|-&lt;br /&gt;
|2:20&lt;br /&gt;
|We get True because 1 is not equal to 2&lt;br /&gt;
|-&lt;br /&gt;
|2:25&lt;br /&gt;
|These are the basic Comparison Operators that you will be using for our tutorials&lt;br /&gt;
|-&lt;br /&gt;
|2:33&lt;br /&gt;
|Expand on this - practice them - and you'll understand them better &lt;br /&gt;
|-&lt;br /&gt;
|2:41 &lt;br /&gt;
|You can also compare variables using these operators.  So for example num1 = 1&lt;br /&gt;
|-&lt;br /&gt;
|2:48&lt;br /&gt;
|num2 = 2.   All we now do is replace these values and there we go&lt;br /&gt;
|-&lt;br /&gt;
|2:58&lt;br /&gt;
|This will produce exactly the same result as we've got earlier -  which is True.   Now all we need to do is change these values&lt;br /&gt;
|-&lt;br /&gt;
|3:05&lt;br /&gt;
|Please note this will now read as num1 = 1 num2 = 1 so if num1 doesn't equal 1 it is False because 1 does equal 1 therefore we get False &lt;br /&gt;
|-&lt;br /&gt;
|3:21&lt;br /&gt;
|These are the simple Comparison Operators. Play around with them. See what you can do.  Thanks for watching. &lt;br /&gt;
|-&lt;br /&gt;
|3:30&lt;br /&gt;
|This is Mad Madhur dubbing for the Spoken Tutorial Project.&lt;br /&gt;
|-&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>