Header Ads

PHP 비교 연산자


/*
==
===
!=
<>
<
>
<=
>=
*/

$a = 1;
$b = 2;

// FALSE
if ($a == $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// FALSE
if ($a === $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// TRUE
if ($a != $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// TRUE
if ($a <> $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// TRUE
if ($a < $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// FALSE
if ($a > $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// TRUE
if ($a <= $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

// FALSE
if ($a >= $b)
{
 echo "TRUE";
}
else
{
 echo "FALSE";
}

No comments

Copyright 2016, minki. All rights reserved. Powered by Blogger.