1首先是try,catch ?php $path="D:\\\\in.txt"; try//检测异常 { file_open($path); } catch(Exception$e)//捕获异常 { echo$e-getMessage(); } functionfile_open($path) { if(!file_exists($path))//如果文件无法找到,抛出异常对象...
?php $o=0.1; for($a=1;$a100;$a++){ $o+=0.1; echo"br/intval('$o')=".intval($o); if(intval($o)){ print("true"); }else{ print("false"); } } ? 结果: intval('0.2')=0false intval('0.3')=0false intval('0.4')=0false intval('0.5')=0false intval('0...
实现打包功能~轻松方便!压缩比虽比winrar差那么一点但是也没啥关系毕竟只打包做下载 省下了自己去服务器上把站点打包如果服务器不是自己的就更麻烦了要让别人帮忙打下包 复制代...
其实php对gzip解压很简单,用内置的gzdecode函数就可以了,不过很可惜我配置了半天也无法支持gzdecode函数,所以只好变通一下: 复制代码 代码如下: if(!function_exists('gzdecode')){ functiongzde...
guestbook.php: head metahttp-equiv="Content-Language"c metahttp-equiv="Content-Type"c title/title STYLEA:link{ COLOR:#002878;TEXT-DECORATION:none } A:visited{ COLOR:#002878;TEXT-DECORATION:none } A:active{ TEXT-DECORATION:none } A:hover{ COL...
HTML部分: html head scrīptlanguage="javascrīpt" functionpostRequest(strURL){ varxmlHttp; if(window.XMLHttpRequest){//ForMozilla,Safari,... varxmlHttp=newXMLHttpRequest(); } elseif(window.ActiveXObject){//ForInternetExplorer varxmlHttp...
?php //这个脚本是用来给用户输入口令,并判断口令是否正确的。 //如果正确则转到欢迎页面。 if($login){ include("../include/config.inc.php3"); session_start(); $right_enter='0'; $query="select*fromuser_define...
在大部分情况下我们指定另外一个来处理表单内容的URL地址给Action属性,但也有部分情况是需要将表单数据提交给自己的。这时候我们应该如何指定Action属性值呢? ?php if(isset($_POST['ac...
1。PHP的__FILE__常量(如何得到根目录) dirname(__FILE___)函数返回的是脚本所在在的路径。 比如文件b.php包含如下内容: $basedir=dirname(__FILE__); ? 如果b.php被其他目录里的a.php文件require或者incl...
!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" htmlxmlns="http://www.w3.org/1999/xhtml" head metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/ titleUntitledDocum...