The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 05:50:36 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: What does triple equals mean in php  (Read 3547 times)
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« on: February 26, 2010, 02:50:07 AM »

Code:
$issuperpage = strpos($content, '$$$superpage$$$');
    if ($issuperpage === false)
    {
      echo 'equals three';
    }

Code:
$issuperpage = strpos($content, '$$$superpage$$$');
    if ($issuperpage == false)
    {
      echo 'equals two';
    }

What is the difference between triple equals and double equals and single equals for that matter?
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #1 on: February 26, 2010, 03:12:21 AM »

The equals sign ASSIGNS a value to a variable name.

The double and triple do comparisons:

http://www.php.net/manual/en/language.operators.comparison.php
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
ehlo
Journeyman
***
Offline Offline

Posts: 50


View Profile
« Reply #2 on: February 26, 2010, 11:28:28 AM »

== tests that the values are equal, while === tests that the value and the type are the same.
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: February 26, 2010, 12:24:46 PM »

it's commonly known as exactly equal as opposed to equal value. Like ehlo said above, that means types as well as value.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nutballs
Administrator
Lifer
*****
Offline Offline

Posts: 5627


Back in my day we had 9 planets


View Profile
« Reply #4 on: February 26, 2010, 08:37:31 PM »

triple is when things are so freakin equal, that double equal, let alone plain old equal dont do it justice.

"that forgery is fucking triple equal the original!"
Logged

I could eat a bowl of Alphabet Soup and shit a better argument than that.
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #5 on: March 01, 2010, 02:37:28 PM »

1 == '1' will evaluate TRUE
1 === '1' will evalutate FALSE
Logged

hai
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!