php 948

#PHP
php日期加减

对于每天的统计数据,我们日期 date("Ymd") 转换成整型来作为数据库的主键,所以在寻找一段时间统计数据的时候需要用到时间的加减; 例如,30天内的数据 …

2015-01-04 246

#PHP
PHP从网络下载文件

set_time_limit(0); // Supports all file types // URL Here: $url = 'http://somsite.com/some…

2015-01-04 119

#PHP
应用curl扩展抓取网页

<?php namespace Think; header("Content-Type: text/html;charset=utf-8"); class…

2015-01-04 789

#PHP
PHP随机颜色生成器

function randomColor() { $str = '#'; for($i = 0 ; $i < 6 ; $i++) { $randNum = rand(0 , …

2015-01-04 965

#PHP
PHP下载文件

$filename = $_GET['file']; //Get the fileid from the URL // Query the file ID $query = spr…

2015-01-04 941

#PHP
php获取当前页面的url地址

<?php // 说明:获取完整URL function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS…

2015-01-04 699

#PHP
PHP将cvs导入到MySql

<?php $databasehost = "localhost"; $databasename = "test"; $databas…

2015-01-04 162

#PHP
php连接mysql操作类

<?php /* * 名称: 数据库连接类 * 介绍: 适用于各种数据库链接 */ class mysql { private $_link; public function…

2015-01-04 521

#PHP
PHP生成随机密码

<?php /* Class MAKEpasswd: Make password from selected characters in a string. required…

2015-01-04 443

#PHP
网上投票系统刷票PHP代码

很多网站上的投票依据是ip地址,不同的ip地址一天可投票一次 下面的代码就是利用curl扩展来伪造ip地址 达到无限制投票; $times = $_POST['times']; /…

2015-01-04 339

#PHP
PHP运行时强制显示出错信息

error_reporting(E_ALL); ini_set('display_errors', '1'); //将出错信息输出到一个文本文件 ini_set('error_lo…

2014-12-31 805

#PHP
php 获取中文字符拼音首字母

//php获取中文字符拼音首字母 function getFirstCharter($str){ if(empty($str)){return '';} $fchar=ord($s…

2014-12-30 713