/** *数字金额转换成中文大写金额的函数 *String Int $num 要转换的小写数字或小写字符串 *return 大写字母 *小数位为两位 **/ function ge…
<?php class Verify{ /** * 验证用户名 * @param string $value * @param int $length * @return b…
用到的函数 ignore_user_abort(),set_time_limit(0),sleep($interval)此代码只要运行一次后关闭浏览器即可。不知道能程序的性能会不会…
<?php class DateFormat { private static $_DIFF_FORMAT = array( 'DAY' => '%s天前', 'DAY…
<?php class Thumb { public function create($srcPath, $dstPath, $dstWidth, $dstHeight) {…
在web开发中,可以通过文件缓存,大大缓解数据库的压力。 如下代码是php中使用文件缓存的例子。 CacheLayer.php <?php class CacheLayer{…
cache.inc.php: <?php class Cache { /** * $dir : 缓存文件存放目录 * $lifetime : 缓存文件有效期,单位为秒 * $…
PHP 文件上传代码示例 <html> <head> <title>图片上传</title> </head> <b…
/********************** *@filename - path to the image *@tmpname - temporary path to thumb…
如下代码实现了301重定向,301重定向是一种seo搜索引擎友好的重定向方式,其用意是告诉搜索引擎现在访问的内容已经转到其他地址了。 如下是php实现301重定向的代码: head…
<?php class Verify{ /** * 验证用户名 * @param string $value * @param int $length * @return b…
有时候需要在服务器端打包文件,可以使用php的ZipArchive相关类实现。 有时候需要在服务器端打包文件,可以使用php的ZipArchive相关类实现。 <?php $…