Results 1 to 4 of 4

Thread: == & ===

  1. #1
    New Member naveenkumar's Avatar
    Join Date
    Oct 2007
    Location
    chennai
    Posts
    6

    Default == & ===

    What is the difference between == & === in php ?

  2. #2
    karan
    Guest

    Default

    Two of the many comparison operators used by PHP are '==' (i.e. equal) and '===' (i.e. identical). The difference between the two is that '==' should be used to check if the values of the two operands are equal or not. On the other hand, '===' checks the values as well as the type of operands.

    Examples:
    1)
    if("22" == 22) echo "YES";
    else echo "NO";

    Ans:Is YES

    2)
    if("22" === 22) echo "YES";
    else echo "NO";

    Ans:Is NO

  3. #3

    Default

    Very good, Karan. I am learning after your explanations. You can upload one specific thread in this kind programming subject and automatically it will be your e-book. This is the beauty of DB that I found very beneficial to members. Any thread never isolated regardless of its date of posting, once dug it resurfaced.
    FOR VISITOR$ TO JOIN THIS FORUM CLICK HERE
    Prosperity sharing with our lovely Digital Bhoomi (DB)
    Follow DB-Twitter Follow DB-YouTube Follow DB-Facebook



  4. #4
    Zealot johnpitter's Avatar
    Join Date
    Jan 2011
    Location
    webmaster
    Posts
    117

    Default

    Nice explanation given by you. I really appreciate your work.

Share this page with your friends

Share this page with your friends

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •