原因分析出現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,將
我們來看看html代碼<form action=111cnNet.php ><input type=text name=username><input type=text name=password><input type=submit name=password value='提交'></form><?php $uname=$_POST["username"];
$ip="2001:0db8:85a3:08d3:1319:8a2e:0370:7334"; 02 //$ip="2001:0db8:85a3:08d3::7334"; 03 if(filter_var($ip,FILTER_VALIDATE_IP,FILTER_FLAG_IPV6)!=false) 04 05 { 06 echo $ip." is an IPv6
<?php /*正則取圖片img標記中的任意屬性*/$word = '<p height="22" align="cenetr">111 22</p> <img src="/upload/images/aaa.jpg" width="100" height="50"/><div style="float:
擷取所有可用的模組 - 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 =
類只能php教程 5.30以上的版本才能使用,繼承了上一個版本的快速重新導向的特點(單獨類,全部使用靜態調用),增添了一個很重要的功能和屬性 可以調用其他url中的模組了 也使得模組與模組間或頁面與頁面間的函數簡化共用得以實現.htaccess檔案寫法: 複製代碼 代碼如下:#-------------- .htaccess start ---------------RewriteEngine on RewriteRule !.(js|ico|gif|jpg|png|css教程|swf|htm|
簡單說一下就是-> 調用對象的成員=> 指定下標下面來看幾個執行個體關於-> 與=>代碼,讓你更清楚是什麼用法與功能並且有什麼區別了。*/// =>用法,可用到數組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 =
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));//擷取檔案件副檔名方法三