Wednesday, 26 February 2014

Triple Equals in php

Operators In Php
This tutorial is for Triple Equals.
Let me justify you difference between Double Equal Operator and Triple Equal Operator:-
Single Equal Operator:-It is used for assigning values.
Double Equal Operator:-It is used for equality between variables and values.
Triple Equal Operator:-It is used for equality between variables and values and there datatype too.


Code for comparison  operators (Screenshot1):-

Screenshot1

Output (Screenshot2) :-

Double equal in php
Screenshot2
In this example we had two variables where num1 is string datatype and num2 is integer datatype.Here,in “Double Equals” we can compare the values of variables num1 and num2,but what if we want to compare datatypes of variable along with the comparison of values.Let’s see an example:-

Code for Triple Equals Operators (Screenshot3):-

Code for triple equals operators
Code for Triple Equals Operators Screenshot3

Output (Screenshot4):-

triple equals in php
Screenshot4
In this example during comparison of datatype of the variable i.e. string and integer, it evaluates false and echo out “Not equal”.


No comments:

Post a Comment

Thanks For Comment Will get you Soon..

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates