if statement

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Xerpher
New php-forum User
New php-forum User
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada
Contact:

Sat Feb 22, 2003 8:37 pm

I understand doing something like this

Code: Select all

if ($one == $two) three();

but what I dont understand is

Code: Select all

if ($one === $two) three();


What is the third equal sign do? I tried searching in php.net but didn't find it.

pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

Sun Feb 23, 2003 3:27 am

=== = exactly the same (including type)

1 == 01
1 !=== 01

1 == '1'
1 !=== '1'

the typecasted === is rarely used though.
avatar image based upon nasas apod (only updates if I post though)

User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Sun Feb 23, 2003 4:54 am

If you want to understand how it's work to you need to know what === it's called like equal if some variables for example $a and $b but $a is string and $b is not yore have a fail :^(
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider] and 7 guests