原因分析出現undefined function curl_init()錯誤是沒有載入函數模組了,因這php curl函數是必須在php.ini中載入php_curl.dll模組才可以,所以原因知道了我們不可以開始操作了。檢查:1. function_exists()下,是否已經支援CURL2. php/ext目錄下,php_curl.dll 是否存在;3. php安裝目錄下,libeay32.dll 和 ssleay32.dll 是否存在!修改配置:1. 修改php.ini,將
擷取所有可用的模組 - get_loaded_extensions該函數返回所有已經載入的(可用的)模組。用法:print_r(get_loaded_extensions()); 2. 擷取指定模組的可用函數 - get_extension_funcs該函數返回指定模組所有可用的函數。傳入的參數(模組名稱)必須是小寫用法:print_r(get_extension_funcs("gd")); 3.
<?php教程 // Ask for Input fwrite(STDOUT, "Please Select Option(Default is Find) [1]Find [2]Replace Please Input Number: ");// Get Input $todo = trim(fgets(STDIN)); if(empty($todo)) $todo =1; if($todo != 1 && $todo !=2){
$sourcecode=getsourcecode("http://www.sogou.com/web?query=".$q);//echo ":".$sourcecode;if($sourcecode){$sourcecode=iconv('gb2312','utf-8',$sourcecode); preg_match('/搜狗評級:(.*?) /', $sourcecode, $cmatche); if($cmatche[
for($i=0;$i<5;$i++){$pagecode = @file_get_contents("http://www.soso.com/q?w=site:".$q); if($pagecode){ break; }}//echo $pagecode; if($pagecode){ preg_match('/搜尋到約(.*?)項結果/',
<?php$action = $_GET['action'];require_once('auc.main.class.inc.php');$auc = new auc();if ($action == 'uploadfile') { $auc = new auc(); $result = $auc->upload("file"); if (is_array($result)) { echo
class Trees{ private $_keyId = 'Id'; private $_keyName = 'Name'; private $_keyFid = 'Fid'; function __construct($keyId='',$keyName='',$keyFid='') { if($keyId==""){$this->_keyId =
class Client{ public function __construct() { /**/ } /** * 擷取瀏覽器用戶端 * * @return string */ public function browser() { $info =
function unicode_urldecode($url) { preg_match_all('/%u([[:alnum:]]{4})/', $url, $a); foreach ($a[1] as $uniord) { $dec = hexdec($uniord); $utf = ''; if ($dec < 128) { $utf = chr($dec); } else if ($dec < 2048) { $utf = chr(192 + (($dec - ($dec %
簡單說一下就是-> 調用對象的成員=> 指定下標下面來看幾個執行個體關於-> 與=>代碼,讓你更清楚是什麼用法與功能並且有什麼區別了。*/// =>用法,可用到數組array,賦值與foreach賦值$array = array("addr" => "www.111cn.net","tel" => "11111111");print_r($array);/*結果為Array(
class cacheClearFile{ var $dir = '111cn.Net'; function __construct() { $this->listFils(); } function
<?php教程 //全國,判斷條件是$REQUEST_URI是否含有html if (!strpos($_SERVER["REQUEST_URI"],".html")) { $page="http://qq.ip138.com/weather/"; $html = file_get_contents($page,'r'); $pattern="/<B>全國主要城市、縣當天和未來五天天氣趨勢預報線上查詢<
$time = '2010-1-11'; //定義一個日間我相把把它變成2010-01-1 $splitDate = explode("-",$time); //進行拆分以"-"分開 $stime =
/* creates a compressed zip file */function create_zip($files = array(),$destination = '',$overwrite = false) {//if the zip file already exists and overwrite is false, return falseif(file_exists($destination) && !$overwrite) { return false; }
function destroyDir($dir, $virtual = false){$ds = DIRECTORY_SEPARATOR;$dir = $virtual ? realpath($dir) : $dir;$dir = substr($dir, -1) == $ds ? substr($dir, 0, -1) : $dir;if (is_dir($dir) && $handle = opendir($dir)){while ($file =
電子郵件驗證也許是中最常用的網頁表單驗證,此代碼除了驗證電子郵件地址,也可以選擇檢查郵件域所屬 DNS 中的 MX 記錄,使郵件驗證功能更加強大。function is_valid_email($email, $test_mx = false){if(eregi("^([_a-z0-9-]+)(.[_a-z0-9-]+)*@([a-z0-9-]+)(.[a-z0-9-]+)*(.[a-z]{2,4})$",
function readable_random_string($length =
class String extends stdClass { private $_val =''; public function __construct( $str ='' ) { $this->_val = $str; } public function __toString() { return $this->_val; } public function encode( $coder ) { $coder ='encode_' . $coder; if(
$array = array('jpg','gif','png','jpeg');$picImg ='/upfile/upload_pic/thumbnail_1258615556.jpg';$img = strtolower($picImg);//擷取檔案件副檔名方法一$ext = substr($img,strrpos($img,'.')+1);//這裡是讀取副檔名的代碼//擷取檔案件副檔名方法二$ext = end(explode('.',$img));//擷取檔案件副檔名方法三
*/$dir ='/www.111cn.net'; if(strstr($src, "http://") && !strstr($src, $_SERVER['HTTP_HOST'])){ $src = getimg($src); } function getimg($l1){ $l2 = $dir.'/'.substr(md5($l1),10,10).strrchr($l1