php中判断自定义方法是否存在
<?php
function myFun(){
echo "hello,张三";
}
//利用function_exists方法判断自动以方法是否存在
//该方法参数为要判断的自定义方法的方法名,可写为
//"myFun"或myFun
if(function_exists(myFun)){
echo "存在";
}else{
echo "不存在";
}
?>
相关文档:
闲话少说,先将它们打包成一个文件就叫fun.php吧
< ?php
function passport_encrypt($txt, $key) {
srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000));
$ctr = 0;
$tmp = ''; ......
header("Content-Type:text/html;charset=utf8"); 放到PHP开头处
$link=mysql_connect("localhost","root","110110");//链接
mysql_select_db("blog",$link);//选择数据库
mysql_query("SET character_set_results=gbk", $link);//字符编码 ......
extract() //将数组中的键名作为变量名,键值作为变量值
例:
form.html
<form action="action.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit&quo ......
只能是window下.
从php 官网上下载 php_gd2.dll (5.2.2版的.)
替换你原来的gd2.
自动抓取网站页面并保存为一个图片.
实现代码如下:
<?php
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Nav ......