一、?答:是超文本预处理语言HypertextPreprocessor的缩写。PHP是一种HTML内嵌式的语言,是一种在服务器端执行的嵌入HTML文档的脚本语言。?答:include产生一个警告,而require则导致一个致命错误。?请举例说明。答:<?php $var='cx'; $VAR='cxi; echo "$var,$VAR"; ?>,但是输出该变量的值总是为其他数字,请问这是什么问题?答:0开头的是八进制。?答:whiledo…whileif….?答:数值型,日期时间型,字符串型。二、,实现以下功能:字符串“open_door”转换成“OpenDoor”、”make_by_id”转换成”MakeById”。答:<?phpfunctionchangeStyle(&$str){/*$str=str_replace("_","",$str);$str=ucwords($str);$str=str_replace("","",$str);return$str;*/$arrStr=explode('_',$str);foreach($arrStras$key=>$value){$arrStr[$key]=strtoupper(substr($value,0,1)).substr($value,1);}returnimplode('',$arrStr);}$s="open_door";echochangeStyle($s);?>,可以遍历目前文件夹下的所有文件和子文件夹。(目录操作)答:<html><head><title>目录输出</title>//P154</head><body><?php$dir=getcwd();echogetcwd().”<br>”;$files1=scandir($dir);$files2=scandir($dir,1);print_r($files1);print_r($files2);$dir=dir($dir);,例如-8-28~-11-12的日期差数答:<?phpclassDtime{functionget_days($date1,$date2){$time1=strtotime($date1);$time2=strtotime($date2);return($time2-$time1)/86400;}}$Dtime=newDtime;echo$Dtime->get_days('-8-8','-11-12');?>,查出所有姓名为“张三”的内容并打印出来假设数据库名为:Student,数据表名为:Info UserNameTelContentDate张三大专毕业-10-11张三本科毕业-10-15张四中专毕业-10-15请根据上面的题目完成代码:$id=mysql_connect(”localhost”,”root”,”pass”);mysql_select_db(”Student”,$id);$xiang=”select
php练习题 来自淘豆网m.daumloan.com转载请标明出处.