dalawh Posted June 27, 2012 Share Posted June 27, 2012 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? Link to comment Share on other sites More sharing options...
astralaaron Posted June 27, 2012 Share Posted June 27, 2012 Try doing var_dump($_COOKIE['value']); to see the data type Link to comment Share on other sites More sharing options...
Guest So Called Posted June 27, 2012 Share Posted June 27, 2012 I recall hearing that $_COOKIE[], $_POST[] etc.are all passed as string values. Link to comment Share on other sites More sharing options...
dalawh Posted June 27, 2012 Author Share Posted June 27, 2012 Try doing var_dump($_COOKIE['value']); to see the data typeIt's a string. I recall hearing that $_COOKIE[], $_POST[] etc.are all passed as string values.Yea, you were right. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now