php 948

#PHP
截取中文字符串PHP代码

/** * * 中文字符串截取 * @param string $string * @param int $sublen * @param int $start * @param …

2015-01-08 374

#PHP
php匹配url的正则表达式

//https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)? //PHP Example: Automatically link UR…

2015-01-08 581

#PHP
图片缩放水印PHP类

/** * 图片缩放水印类 * */ class cls_photo { protected $waterrate = 0.2; //水印图标在图片上的比例 protected $…

2015-01-08 281

#PHP
漂亮的 PHP 验证码类

<?php class Page { private $total; //总记录 private $pagesize; //每页显示多少条 private $limit; /…

2015-01-07 884

#PHP
PHP实现的计划(定时)任务

有时候为了定时去调接口,需要程序自动运行。从网上搜到有两种方法可以实现 1、ignore_user_abort() ignore_user_abort()函数搭配set_time_…

2015-01-07 958

#PHP
连接 MySQL 数据库PHP代码

<?php $host="localhost"; $uname="database username"; $pass="da…

2015-01-07 261

#PHP
使用 PHPMailer 发送邮件

PHPMailer 的官方网站:http://phpmailer.worxware.com/ PHPMailer 最新类库下载地址:【点击下载】 PHPMailer GitHub …

2015-01-07 787

#PHP
PHP 工具类库

<?php /** * 常用工具类 * author Lee. * Last modify $Date: 2012-8-23 */ class Tool { /** * js…

2015-01-07 826

#PHP
php使用array_rand生成随机密码

非常简单好用的随机密码生成,喜欢任何字符自己都可以加 function rand_word($num=12){ $re=''; $list="abcdefghijklmn…

2015-01-06 864

#PHP
php上传图片生成缩略图

<?php function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidt…

2015-01-06 694

#PHP
php随机生成易于记忆的密码

function random_readable_pwd($length=10){ // the wordlist from which the password gets gen…

2015-01-06 661

#PHP
PHP 的单例模式代码

class User { static function getInstance() { if (self::$instance == NULL) { // If instance…

2015-01-06 410