Time of Update: 2016-07-25
/* * curl_multi 經測試,大於四個網址時要比Foreach迴圈快.. * by wc1217 * edit:bbs.it-home.org */ class curl_multi{ //Curl控制代碼 //private $curl_handle = null; //網址 private $url_list = array(); //參數 private $curl_setopt = array( '
Time of Update: 2016-07-25
$ret = '';$arrs = array(array(1,'test1'), array(2,'test2'), array(3,'test3'), array(4,'test4'), array(5,'test5'), array(6,'test6'), array(7,'test7') );foreach($arrs
Time of Update: 2016-07-25
/** * 分割字串 * @param String $str 要分割的字串 * @param int $length 指定的長度 * @param String $end 在分割後的字串塊追加的內容 */ function mb_chunk_split($string, $length, $end, $once = false){ $string = iconv('gb2312', 'utf-8//ignore', $string);
Time of Update: 2016-07-25
class DBManager{ var $dbHost = ''; var $dbUser = ''; var $dbPassword = ''; var $dbSchema = ''; function __construct($host,$user,$password,$schema) { $this->dbHost = $host; $this->dbUser = $user;
Time of Update: 2016-07-25
//源圖的路徑,可以是本地檔案,也可以是遠程圖片$src_path = '1.jpg';//最終儲存圖片的寬$width = 160;//最終儲存圖片的高$height = 120;//源圖對象$src_image = imagecreatefromstring(file_get_contents($src_path));$src_width = imagesx($src_image);$src_height = imagesy($src_image);//產生等比例的縮圖$tmp_image_
Time of Update: 2016-07-25
define("BASEPATH", dirname(__FILE__).'/'); function &get_instance(&$class_object){ return $class_object;} function log_message(){}// 影像處理類位置 CodeIgniter: ./system/libraries/Image_lib.phpinclude("Image_lib.php"); $config['image_library'] =
Time of Update: 2016-07-25
/************* PHP匯入.sql檔案運行版本:php5,php4作者:panxp 郵件:coolpan123@gmail.com*編輯整理:bbs.it-home.org**************/$host = "localhost";$user = "root";$pwd = "";$file_dir = dirname(__FILE__);$file_name = "bar.sql";$data_base = "test";$conn =
Time of Update: 2016-07-25
tar zxvf zlib-1.2.3.tar.gz cd zlib-1.2.3 ./configure --prefix=/usr/local/zlib make make install複製代碼2,安裝libpng tar zxvf libpng-1.2.8.tar.tar cd libpng-1.2.8 mv ./scripts/makefile.linux ./makefile make make install 複製代碼注意,這裡的makefile不是用./configure產生,
Time of Update: 2016-07-25
/*** 遞迴擷取目錄與子目錄中的檔案* by bbs.it-home.org*/function readFileFromDir($dir) { if (!is_dir($dir)) { return false; } //開啟目錄 $handle = opendir($dir); while (($file = readdir($handle)) !== false) { //排除掉目前的目錄和上一個目錄 if
Time of Update: 2016-07-25
介紹下突破php上傳檔案大小限制的方法,包括php檔案上傳以及phpmyadmin相關配置方法,有需要的朋友參考下。phpmyadmin匯入SQL檔案時,遇到上傳檔案大小限制問題,預設phpmyadmin上傳檔案大小為2M,如果想要phpmyadmin上傳超過2M大檔案,則需要修改phpmyadmin上傳檔案的大小配置或者將大檔案分幾批上傳,相對來說修改phpmyadmin上傳檔案大小的限制來得方便很多。解決phpmyadmin上傳檔案大小限制問題,需要修改php.ini設定檔與phpmyadm
Time of Update: 2016-07-25
header("content-type:text/html;charset=gbk"); ini_set("date.timezone","Asia/chong"); //判斷檔案是否為空白 if(empty($_FILES)){ echo"上傳檔案過大"; exit; } //判斷檔案上傳是否有錯誤 if($_FILES['pic']['error']){ echo "上傳檔案"; exit; } //判斷檔案類型是否非法擷取檔案尾碼 $allowtype=array("jpg","png"
Time of Update: 2016-07-25
如何修改php與apache中的上傳檔案大小限制呢?即修改php檔案上傳時的限制的方法。有需要的朋友參考下。程式遷移過程中,發現不能上傳大於2m的檔案了,首先檢查Localsetting.php檔案,這個是設定檔,其中有:$wgUploadSizeWarning =
Time of Update: 2016-07-25
在php中上專檔案大小限制的問題如何解決呢?主要是修改設定檔php.ini中的內容,來突破php上傳檔案大小的限制。從 PHP 4.2.0 開始,PHP 將隨檔案資訊數組一起返回一個對應的錯誤碼。該代碼可以在檔案上傳時產生的檔案數組中的 ['error'] 欄位中被找到,也就是 $_FILES['userfile']['error']。UPLOAD_ERR_INI_SIZE值:1; 上傳的檔案超過了 php.ini 中 upload_max_filesize 選項限制的值。UPLOAD_ERR_
Time of Update: 2016-07-25
/** php短網址產生* edit: bbs.it-home.org*/class Base62{ private static $base62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; public static function encode($number, $encode = ''){ while($number > 0){ $mod = bcmod($number, 62);
Time of Update: 2016-07-25
//載入PHPExcel類include(dirname(__FILE__).'/phpexcel/PHPExcel.php');$Obj = new PHPExcel_Reader_Excel5();$Obj->setReadDataOnly(true);//讀取demo.xls檔案$phpExcel = $Obj->load(dirname(__FILE__).'/output.xls');//擷取當前活動sheet$objWorksheet =
Time of Update: 2016-07-25
介紹下修改php上傳檔案大小限制的方法,分windows與linux兩種環境,分別介紹下php上傳限制的解決方案,有需要的朋友參考下。本節內容:修改php上傳檔案時的大小限制,突破上限制。一,Windows 環境第一步:修改在php5下POST檔案大小的限制1,編修php.ini找到:max_execution_time = 30 ,這個是每個指令碼啟動並執行最長時間,單位秒,修改為:max_execution_time = 150找到:max_input_time =
Time of Update: 2016-07-25
urlShort-php產生短網址_bbs.it-home.org_指令碼學堂提供 複製代碼2,產生php短網址的代碼。 header("Content-Type:text/html;charset=UTF-8"); function base62($x){ $show = ''; while($x>0){ $s = $x % 62; if ($s > 3
Time of Update: 2016-07-25
$content='';$fp = fsockopen("bbs.it-home.org", 80, $errno, $errstr, 30);if (!$fp) { echo "$errstr ($errno)\n";} else {$out = "POST /test.php?id=5".$content." HTTP/1.1\r\n";$out .= "Host:www.php100.com\r\n";$out .= "Content-Length: ".
Time of Update: 2016-07-25
$dbconn = array( 'dns'=>"mysql:host=localhost;dbname=soa", 'dbuser'=>'root', 'dbpwd'=>'123456');try{ $db = new PDO($dbconn['dns'],$dbconn['dbuser'],$dbconn['dbpwd']); $db->query("set names utf8"); $update = "update wp_links set link_url =
Time of Update: 2016-07-25
/** * Images類 圖片處理類 * @author pan * @package application.controllers * @since 1.0 */class Images { /** * 縮放圖片 * @param $source原圖片 * @param $newfile新圖片 * @param $pre縮放比例 */ public function thumn($source,$pre,$newfile) { //擷取圖片尺寸