批改状态:合格
老师批语:
// + - *(×) /(÷) %(取模,取除不尽的余数)$a=10;$b=4;echo $a+$b; //14echo $a-$b; //6echo $a*$b; //40echo $a/$b; //2.5echo $a%$b; //2
echo $a+=$b; //14echo $a-=$b; //6echo $a*=$b; //40echo $a/=$b; //2.5echo $a%=$b; //2$c='大家';echo $c[0],$c[1],$c[2]; //大
$d='<div>a123a';trim($d); //去除字符串首尾处的空白字符(或者其他字符,比如html标签)is_numeric($d); //判断是否是数字类型is_int($d); //判断是否是int整数类型
function tab($ar,$he,$width,$height){$table='<table border="1" cellspacing="0">';//第一个变量不使用.链接符$table.='<thead>';$table.='<tr>';foreach ($he as $k => $v) {$table.='<th width="'.$width.'" height="'.$height.'">'.$v.'</th>';}$table.='</tr>';$table.='</thead>';$table.='<tbody align="center">';foreach ($ar as $k2 => $v2) {$table.='<tr>';foreach ($v2 as $k3 => $v3) {$table.='<td>'.$v3.'</td>';}$table.='</tr>';}$table.='</tbody>';$table.='</table>';return $table;}echo tab($arr,$head,100,200);
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号