$a = 10;
$a = 20;
$b = 5;
const VALUE = 100;
define(‘NUM‘,200);
$c = $a+$b+VALUE+NUM;
echo $c;
function getLevel($score){
if($score>90){
return ‘excellent‘;
}elseif($score>80){
return ‘very good‘;
}elseif($score>70){
return ‘good‘;
}else{
return ‘bad‘;
}
}
echo getLevel(92);
$a = ‘3.94iu‘;
$a = intval($a);
echo $a;
function getLevel($score){
switch(intVal($score/10)){
case 10:
case 9:
return ‘excellent‘;
case 8:
return ‘very good‘;
default:
return ‘bad‘;
}
}
echo getLevel(83);
function add($n){
$sum = 0;
for($i=1;$i<=$n;$i++){
$sum += $i;
}
return $sum;
}
echo add(100);
if($i=1){
echo ‘hello world‘;
}else{
echo ‘fuck‘;
}
$str = ‘hello php java C#‘;
//echo strpos($str,‘o‘);
$str1 = substr($str,2);
$arr = array(‘h‘=>‘hello‘,‘w‘=>‘world‘);
echo $arr[‘w‘];
require_once ‘lib.php‘;
sayHello();