-
水印 php给图片加水印函数 日期:2014-06-27 15:17:54 点击:128 好评:0
php给图片加水印函数 **php给图片加水印函数**```{php}function watermark($imagesource){$filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == quot;...
-
php实现的MySQL备份类 日期:2014-06-27 15:17:41 点击:55 好评:0
php实现的MySQL备份类 ```phplt;?php define(#39;MSB_VERSION#39;, #39;1.0.0#39;); define(#39;MSB_NL#39;, quot;\r\nquot;); define(#39;MSB_STRING#39;, 0); define(#39;MSB_DOWNLOAD#39;, 1); define(#39;MSB_SAVE#39;, 2); d...
-
php制作缩略图和加水印的类 日期:2014-06-27 15:17:24 点击:193 好评:0
php制作缩略图和加水印的类 **[PHP]代码**```{.php}/** * 图片缩放水印类 * * @version 1.0 ; * */class cls_photo{ protected $waterrate = 0.2; //水印图标在图片上的比例 protected $wi...
-
php根据UserAgent判断访问者操作系统 日期:2014-06-27 15:17:09 点击:143 好评:0
php根据UserAgent判断访问者操作系统 如下php代码,根据用户的UserAgent信息来获取访问者操作系统**[PHP]代码**```{.php}lt;? function osinfo() { $os=quot;quot;; $Agent = $GLOBALS[quot;HTTP_USER_AGENTquot;]; if (...
-
php解析RSS的类实现 日期:2014-06-27 15:16:56 点击:138 好评:0
php解析RSS的类实现 ```{php}lt;?phperror_reporting(E_ALL); mysql_connect(quot;localhostquot;,quot;rootquot;,quot;rootquot;) or die (mysql_error());mysql_select_db(quot;oopquot;) or die (mysql_error()); class RSS { var $XMLdump; va...
-
php类自动加载器 日期:2014-06-27 15:16:42 点击:193 好评:0
php类自动加载器 兼容以下格式 Cache_File_Json class_xxx.php xxx.class.php xxx.php```{.php}function __autoload($className){$dirs=explode(#39;_#39;,$className);$fileName=array_pop($dirs);//...
-
php计算页面执行时间代码 日期:2014-06-27 15:16:28 点击:67 好评:0
php计算页面执行时间代码 ```{php}lt;? class c_Timer { var $t_start = 0; var $t_stop = 0; var $t_elapsed = 0; function start() { $this-gt;t_start...
-
php 使用GD库为图片加水印 日期:2014-06-27 15:01:59 点击:110 好评:0
php 使用GD库为图片加水印 **[PHP]代码**```{.php}lt;?php header (quot;Content-type: image/pngquot;); $conn = MYSQL_connect(quot;localhostquot;, quot;rootquot;, quot;quot;); //连接数据库 $colname_rs_article = $_GET[#39;id#39;];...
-
php MD5加密解密 日期:2014-06-27 15:01:46 点击:176 好评:0
php MD5加密解密 ```{php}function md5_encrypt($plain_text, $password, $iv_len = 16){ $plain_text .= quot;\x13quot;; $n = strlen($plain_text); if ($n % 16) $plain_text .= str_repeat(quot;\0quot;, 16 - ($n % 16));...
-
php UBB代码转换为html代码函数实现 日期:2014-06-27 15:01:25 点击:101 好评:0
php UBB代码转换为html代码函数实现 在一些论坛中经常需要使用UBB代码转html,如下是一个php转换ubb为html的函数。```phplt;?function ubb($content){ $content = preg_replace(quot;#/[code/](.*?)/[/code]#siquot;,q...
-
php 检测QQ号码的正则表达式 日期:2014-06-27 15:01:11 点击:99 好评:0
检测QQ号码的正则表达式 检测QQ号码的正则表达式```{.php}// 检测QQfunction isQQ($qq){ return preg_match(#39;/^[1-9][0-9]{4,9}$/#39;, $qq);}```...
-
PHP实现的UBB转换html函数 日期:2014-06-27 15:00:58 点击:105 好评:0
PHP实现的UBB转换html函数 php ubb代码转换函数```phplt;?phpfunction ubb($string) { $searcharray[#39;bbcode_regexp#39;] = array( quot;/s*[quote][nr]*(.+?)[nr]*[/quote]s*/isquot;, quot;/([box=(#[0-9A-F]{6}|[a-z]+)])[nr]*(.+?...
-
php使用mysql内存表做session存储 日期:2014-06-27 15:00:22 点击:103 好评:0
php使用mysql内存表做session存储 内存表使用哈希散列索引把数据保存在内存中,因此具有极快的速度,适合缓存中小型数据库,但是使用上受到一些限制,以下是蓝草使用的一些感受。...
-
php生成图片缩略图代码类 日期:2014-06-27 15:00:01 点击:77 好评:0
php生成图片缩略图代码类 生成多种类型的缩略图**[PHP]代码**```{.php}lt;?php/****************************************作者:落梦天蝎(beluckly)*完成时间:2006-12-18*类名:CreatMi...
-
PHP基于md5生成短HASH的代码 日期:2014-06-27 02:19:05 点击:90 好评:0
PHP基于md5生成短HASH的代码 ```{.php}/********** CHash provides users with a fairly strong but short hash for identification* Based on MD5**********/class stdHash{var $hashIn = #39;#39;;function __construct($hashIn=#39;...
-
php获得随机颜色的代码 日期:2014-06-27 02:18:45 点击:187 好评:0
php获得随机颜色的代码 如下代码片段```{.php}lt;?php function randColor(){ $letters = quot;1234567890ABCDEFquot;; for($i=1;$ilt;6;$i++){ $pos = rand(0,16); $str .= $string{$po...
-
php将session保存到数据库类 日期:2014-06-27 02:18:32 点击:63 好评:0
php将session保存到数据库类 php默认情况下是把session保存在文件中的,如果要保存到数据库则需要自己实现类了。需要注意的是session读取很很频繁,如果用mysql的建议用内存数...
-
php使用gmail发邮件 日期:2014-06-27 02:18:18 点击:101 好评:0
php使用gmail发邮件 php使用gmail发邮件的代码片段:```phplt;?php require_once quot;Mail.phpquot;; $from = quot;lt;from.gmail.comgt;quot;; $to = quot;lt;to.yahoo.comgt;quot;; $subject = quot;Hi!quot;; $body = quot;Hi,\n\nHo...
-
php使用正则表达式验证url是否合法 日期:2014-06-27 02:18:04 点击:69 好评:0
php使用正则表达式验证url是否合法 ```phpfunction validateURL($URL) { $pattern_1 = quot;/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/iquot;;...
-
php实现的验证码 日期:2014-06-27 02:17:50 点击:140 好评:0
php实现的验证码 新方式其实也不难懂,就是从 10 个字符中找出 4 个颜色不同的数字字符,而在工行的案例里面还包括了一个中文的文字描述,可能这样用户能更清楚该...