PHP复习笔记
2015-09-28 21:12
671 查看
$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();
$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();
相关文章推荐
- ThinkPHP--项目分组设置(前后台分组)
- 利用ContentProvider实现查看、添加系统联系人
- (php)mysql的int和float
- PHP画图之GD库的使用——略缩图(二)
- win7搭建NTP服务
- 《php和mysql web开发》笔记——第2章数据的存储与检索
- Thinkphp---快捷操作方法:(即快捷函数)
- PHP安全编程:记住登录状态的安全做法
- ThinkPHP--空操作处理和空控制器处理
- PHP 操作MySQL:增删改查
- arcmap制作tpk切片文件形成离线地图包
- yii框架
- PHP过滤各种HTML标签
- PHP知识
- 使用PSFTP工具传输文件的命令使用方法
- 外网访问内网的FTP服务器-原理解析
- 用 PHP 发邮件
- php冒泡排序实例代码
- PHP 性能分析 xhprof 安装
- phpmyadmin乱码问题