Jump to content
dalawh

Quick Identical Comparison Operator Question

Recommended Posts

Identical Comparison Operator: ===It compares the value and the type. I created a cookie and the value I used was 0. I compared it like this "if($_COOKIE['value']===0){ echo 'EQUAL';}". It seems to not be the same. Can anyone explain to me why? Aren't they both like integers?

Share this post


Link to post
Share on other sites
Guest So Called

I recall hearing that $_COOKIE[], $_POST[] etc.are all passed as string values.

Share this post


Link to post
Share on other sites
Try doing var_dump($_COOKIE['value']); to see the data type
It's a string.
I recall hearing that $_COOKIE[], $_POST[] etc.are all passed as string values.
Yea, you were right. Thanks.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...