php function GetHttpStatusCode($url){ $curl = curl_init(); curl_setopt($curl,CURLOPT_URL,$url);//获取内容url
php /** desc:采集网页中的邮箱的代码 */ $url='http://www.xxx.net'; //要采集的网址 $content=file_get_contents($url); //echo
second';if($secs<>1){$r.='s';} return $r; } 用法: php $seconds = "56789"; $output = secsToStr($seconds);
获取访问者IP地址 [PHP]代码 static public function getip() { if (getenv("HTTP_CLIENT_IP") && strcasecmp(gete
php date_default_timezone_set('PRC'); $date = "1351836000"; echo tranTime($date); function transfer_time($time)
这个php函数可以把指定的颜色变得更深一些 function ColorDarken($color, $dif=20){ $color = str_replace('#', '', $color); if
PHP星期几获取代码: date("l"); //data就可以获取英文的星期比如Sunday date("w"); //这个可以获取数字星期比如123,注意0是星期日 获取中文星期几: $weekarray=array("日"
这段php代码可以把一个颜色变成与之相反的颜色编码,如:白色变成黑色,蓝色变成黄色 function color_inverse($color){ $color = str_replace('#', ''
php遍历某文件夹下的所有文件和文件夹 function list_dir($dirpath){ if($dirpath[strlen($dirpath)-1]!="\\"){$dirpath.="\\";}
php /* * array unique_rand( int $min, int $max, int $num ) * 生成一定数量的不重复随机数 * $min 和 $max: 指定随机数的范围
php中可以显示文件的各种属性,这些属性包括文件的最后访问时间、最后修改时间、文件大小等。
return the clean text return $output; } 用法: php $text = ""; $text = clean($text);
如题 利用PHP内置dir类实现目录遍历删除 function clearDir( $dir ) { if (file_exists( $dir )) { if(!is_dir( $dir ))
http://meego123.net/ [PHP]代码 php function Pinyin($_String, $_Code='UTF8'){ //GBK页面可改为gb2312,其他随意填写为UTF8
在PHP网站开发中,验证码可以有效地保护我们的表单不被恶意提交,但是如果不使用算式验证码或者汉字验证码,仅仅使用简单的字母或者数字验证码,这样的验证码方案真的安全吗? 大家知道简单数字或者字母验证
php /* * Zip file creation class. * Makes zip files. * * Based on : * * http://www.zend.com/codex.php
php function getImageInfo($img) //$img为图像文件绝对路径 { $img_info = getimagesize($img); switch ($img_info[2])
php 四舍五入的三种方法,分别通过number_format函数、round函数和sprintf格式化输出的方法实现四舍五入 1.number_format 方法实现四舍五入 $number = 1234
php计算两个坐标(经度,纬度)之间的距离,返回结果为米或者千米 function distance($lat1, $lng1, $lat2, $lng2, $miles = true) { $pi80
php function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth, $quality){