Blogger Information
Blog 5
fans 0
comment 0
visits 2815
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
11.12 变量 运算符 逻辑运算符
肖申克
Original
637 people have browsed it

<?php
$bool = true;
$notBool='lol';
$int = 1;
$notInt='1';
$float = 1.23;
$notFloat = 'hi';
$str = 'i am a string';
$notStr= 2;
$null= null;

$ten = 10;
$two=2;
$three=3;

var_dump(is_bool($bool));
var_dump(is_bool($notBool));

var_dump(is_int($int));

var_dump(isset($null));
var_dump(empty($null));
echo "<hr>";
echo $ten+$two;
echo '<br>';
echo $ten-$two;
echo '<br>';
echo $ten*$two;
echo '<br>';
echo $ten/$two;
echo '<br>';
echo $ten%$three;
echo '<br>';
echo $ten++;
echo '<br>';
echo ++$ten;
echo '<br>';
echo $ten--;
echo '<br>';
echo --$ten;
echo '<br>';
echo $ten . $two;

echo "<hr>";

var_dump($ten>$two);
var_dump($ten>=$two);
var_dump($ten<$two);
var_dump($ten==$two);
var_dump($ten!=$two);
var_dump($ten===$ten);

echo "<hr>";
if ($ten>$two && $three>$two){
   echo 'this is true';
}
echo "<br>";
if ($ten>$two || $three<$two){
   echo 'this is true';
}

if (!false){
   echo '<br>'.'true';
}else {
   echo "<br>".'false';
}

?>

Screen Shot 2019-11-13 at 11.09.06 PM.png

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post