码迷,mamicode.com
首页 > Web开发 > 详细

PHP复习笔记

时间:2015-09-28 22:16:26      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

$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();

PHP复习笔记

标签:

原文地址:http://www.cnblogs.com/htmlphp/p/4844991.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!