原创 php http_build_query (用法)

<?php $data = array('foo'=>'bar', 'baz'=>'boom', 'cow'=>'milk', 'php'=>'hyper

原创 PHP實現短網址開源API,不需DB

配置文件 <?php /*網址設置*/ define(SITE,"http://xxx.com");//域名後面不要加/ /*API設置*/ define(API_KEY,"");//API,申請地址:http://qita.in/re

原创 php mvc 源碼已經放出,請大家指點!

源碼地址:php mvc 源碼地址

原创 php & 和 & (主要是url 問題)

ini_set('arg_separator.output','&');也可以在php.ini 修改

原创 瀑布流

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

原创 緩存類

1、緩存數據 2、得到數據 3、判斷緩存數據是否存在 4、刪除某個緩存數據 5、清除過時的緩存數據 6、清除所以的緩存數據 class Inc_FileCache{ private $cache

原创 php 數據庫備份、還原

1. mydb.php //DB類 2. backup.php //備份腳本 3. restore.php //還原腳本 mydb.php <? class db{ var $linkid; var $sqlid; var $rec

原创 javascript 55個小技巧

1. οncοntextmenu="window.event.returnValue=false" 將徹底屏蔽鼠標右鍵 <table border οncοntextmenu=return(false)><td>no</table>

原创 php json增加積分函數

function zeng_integral(){ $jifen=& m('integral'); /*判斷網吧*/ $store=isset($store_id)?intval($store_id):0; $injifen=$j

原创 php 緩存類

<?php class CacheException extends Exception {} /** * 緩存抽象類 */ abstract class Cache_A

原创 收藏

<?php $path='D:/wamp/www/DolrPHP/Smarty'; function loseWeight($path){ $handle=opendir($path);

原创 DIRECTORY_SEPARATOR,PATH_SEPARATOR,get_include_path

DIRECTORY_SEPARATOR:路徑分隔符,linux上就是’/’ windows上是’\’ PATH_SEPARATOR:include多個路徑使用,在win下,當你要include多個路徑的話,你要用”;”隔開,但在linu

原创 php 文章分頁

<?php /*文章分頁代碼*/ $fp=fopen('txt.txt','r'); while (!feof($fp)){ $content.=fgets($fp); } $c_page=""; if(isset($_GET[

原创 call_user_func 和call_user_func_array 簡單的用法

function test($arg1,$arg2){ echo $arg1; echo $arg2; } call_user_func_array('test',array('555','666')); call_user_fun

原创 生成會員卡或優惠券

for ($i = 0, $j = 0; $i < $num; $i++) { //$cardcode = ($maxcode+ $i).str_pad(mt_rand(0, 9999), 4, '