myProgrammingNote
Saturday, January 1, 2011
php - "===" operator
<?php
$str = '7';
$int = 7;
//usual stuff
$result = ($str == $int);
echo "result is $result<br />";
//returns false because type is not the same
$result = ($str === $int);
echo "result is $result<br />";
?>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment