function write ( $data ) { $return = false; if ( $handle = @fopen ( 'error.txt','a+' ) ) {…
php中可以通过设置header的content-type,强制用户下载内容,而非直接在浏览器中打开,如下代码实现: downloadFile.php <?php $file…
//https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)? //PHP Example: Automatically link UR…
/** * 图片缩放水印类 * */ class cls_photo { protected $waterrate = 0.2; //水印图标在图片上的比例 protected $…
function smart_resize_image( $file, $width = 0, $height = 0, $proportional = false, $outpu…
/** * 过滤字符串中的html标签 * * @param string $string 待转换的字符串 * @return string */ static public fu…
/** * 多个连续空格只保留一个 * * @param string $string 待转换的字符串 * @return unknown */ static public fun…
//PHP(前提是装了curl): $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, "http://www.xxx/&…
可以用{Y}{m}{n}来变成现在的日期 set_dir(dirname(__FILE__).'/upload/','{y}/{m}'); //保存路径,支持{y}{m}{d}这几…
在使用php编程的时候, 很多时候需要对上传的图片加水印,来确定图片版权和出处. 但是,一般情况下加水印的位置是图片的右下角,但是,不同图片的色阶不同,有时候我们图片的水印和图片本…
<? /** * 验证码类 * @author firerat * @email lukai_rat@163.com * @time Feb 16 2011 15:28 * …
//获取某个月的最后一天或某个月的天数 function getMonthLastDay ( $month, $year ) { switch ( $month ) { case …