<?php date_default_timezone_set('PRC'); // 设置时区 $date1 = strtotime('2015-01-01'); //把日期…
仿写CI的,带测试实例。 mongo_config.php <?php $config["host"] = "localhost"; …
<?php function my_image_resize($src_file, $dst_file , $new_width , $new_height) { $src_…
php类库给现有的图片加文字水印,代码不是很完善,欢迎大家多多指教!代码如下: <?php /*PHP图片加文字水印类库 QQ:3697578482 伤心的歌 该类库暂时只支…
/** * 全角字符转换为半角字符 */ function make_semiangle ( $str ) { $arr = array ( '0' => '0', '1' …
对于每天的统计数据,我们日期 date("Ymd") 转换成整型来作为数据库的主键,所以在寻找一段时间统计数据的时候需要用到时间的加减; 例如,30天内的数据 …
set_time_limit(0); // Supports all file types // URL Here: $url = 'http://somsite.com/some…
<?php namespace Think; header("Content-Type: text/html;charset=utf-8"); class…
function randomColor() { $str = '#'; for($i = 0 ; $i < 6 ; $i++) { $randNum = rand(0 , …
$filename = $_GET['file']; //Get the fileid from the URL // Query the file ID $query = spr…
error_reporting(E_ALL); ini_set('display_errors', '1'); //将出错信息输出到一个文本文件 ini_set('error_lo…
function check_html($html) { preg_match_all("/<([a-zA-Z0-9]+)\\s*[^\\/>]*>/&…
php时间比较函数,返回两个日期相差几秒、几分钟、几小时或几天