Time of Update: 2017-01-13
file_get_contents() 函數把整個檔案讀入一個字串中。和 file() 一樣,不同的是 file_get_contents() 把檔案讀入一個字串。file_get_contents()
Time of Update: 2017-01-13
tanh() 函數返回雙曲正切。文法tanh(x)參數 描述 x 必需。一個數。說明返回 x 的雙曲正切值,定義為 sinh(arg)/cosh(arg)。*/echo tanh(-m_pi); //輸出-0.996272076221echo "<br>";echo tanh(1/2); &
Time of Update: 2017-01-13
定義和用法is_infinite() 判斷是否為無限值。文法is_infinite(x)參數 描述 x 必需。規定要檢查的值。說明如果 x 為無窮大(正的或負的),例如 log(0) 的結果或者任何超出本平台的浮點數範圍的值,則返回 true function is_w_x_z($number) //自訂函數擴充判斷功能{
Time of Update: 2017-01-13
function do_call($host,$port,$request) //定義函數{ $fp=fsockopen($host,$port,$errno,$errstr); $query="post /default/php教程/server.php http/1.0nuser_agent:this is a dummy
Time of Update: 2017-01-13
//發送標頭檔header("content-type: image/png");//建立真彩色映像$im=imagecreatetruecolor(100,50);//定義黑色$black=imagecolorallocate($im,0,0,0);//定義白色$white=imagecolorallocate($im,255,255,255);//畫一矩形並填充imagefilledrectangle($im,0,0,99,49,
Time of Update: 2017-01-13
array imagettftext ( resource image, int size, int angle, int x, int y, int color, string fontfile, string text)imagettftext() 將字串 text 畫到 image 所代表的映像上,從座標 x,y(左上方為 0, 0)開始,角度為 angle,顏色為 color,使用 fontfile 所指定的 truetype 字型檔。根據 php教程 所使用的 gd 庫的不同,如果
Time of Update: 2017-01-13
$values=array( 40,50, //第一個頂點的座標 20,240, //第一個頂點的座標
Time of Update: 2017-01-13
$ip="127.0.0.1"; //定義ip地址$long=ip2long($ip); //轉換ip地址為整數if($long==-1||$long===false) &n
Time of Update: 2017-01-13
image_type=image_type_to_mime_type(imagetype_png); //擷取png的mime類型echo $image_type; //輸出結果//$file = '1.jpg';$image = imagecreatefromjpeg($file);header('content-type: ' .
Time of Update: 2017-01-13
*/$result=closelog(); //關閉系統日誌if($result){ echo "系統日誌已經關閉"; //輸出結果}//define_syslog_variables(); //清空所有系統日誌echo
Time of Update: 2017-01-13
下面來看介紹與執行個體。parse_url($str url);把url轉換成數組print_r(parse_url("www.111cn.net")); //解析url並輸出返回數組/*url 專用格式字串還原成一般字元串。文法: string rawurldecode(string str);傳回值: 字串函數種類: 編碼處理 內容說明本函數將字串解碼。從 url
Time of Update: 2017-01-13
*/$hostname=gethostbyaddr($_server['remote_addr']); //擷取主機名稱echo $hostname; //輸出結果//$hosts=gethostbynamel('localhost'); &
Time of Update: 2017-01-13
string getservbyport ( int $port , string $protocol )*/$services=array('80','21','22','23','25','143'); //定義數組foreach($services as $service) //迴圈讀取內容{
Time of Update: 2017-01-13
<?php教程/* 函數定義: * 1.函數是一個被命名的 * 2.獨立的程式碼片段 * 3.函數執行特定任務 * 4.並可以給調用它的程式返回一個值 * * 函數的優點: * 1.提高程式的重用性 * 2.提高程式的可維護性 * 3.可以提高開發效率 * 4.提高軟體的可靠性 *
Time of Update: 2017-01-13
php教程 ereg()把htm轉換成xml檔案實現方法文法: int ereg(string pattern, string string, array [regs]);傳回值: 整數/數組 <?php$text = "<p>This is some text here "</p>".</p>"; ereg("<p>(([^<"]|[^<]*<[^/][
Time of Update: 2017-01-13
利用php教程的http_referer函數來判斷使用者的來路,這是簡單了,執行個體<?php if (isset($_SERVER['HTTP_REFERER']))
Time of Update: 2017-01-13
php教程 自定字串中的部分字元進行替換方法substr_replace()函數對自定字串中的部分字元進行替換 文法:substr_replace(str,repl,start,[int length]) 文法說明: str——必選參數,指定要操作的原始字串 repl——指定替換後的新字串
Time of Update: 2017-01-13
php教程 date()日期時間函數詳解php date() 函數可把時間戳記格式化為可讀性更好的日期和時間。文法date(format,timestamp)參數 描述 format 必需。規定時間戳記的格式。 timestamp 可選。規定時間戳記。預設是當前的日期和時間要找出前一天的時間就是 time()-60*60*24; 要找出前一年的時間就是 time()*60*60*24*365 那麼如何把這個數字換成日期格式呢 ,就要用到date()函數了$t=time();echo date(&
Time of Update: 2017-01-13
php教程 method_exists 檢測類中是否包括函數method_exists() 函數的文法如下:bool method_exists ( object object, string method_name)method_exists() 函數的作用是檢查類的方法是否存在。如果 method_name 所指的方法在 object 所指的對象類中已定義,則返回 true,否則返回 false class a { public
Time of Update: 2017-01-13
在這裡我們全用到時間戳記mktime(hour,minute,second,month,day,year,[is_dst]) 其參數可以從右向左省略,任何省略的參數都會被設定成本地日期和時間的當前值。 參數 描述 hour 可選。規定小時。 minute 可選。規定分鐘。 second 可選。規定秒。 month 可選。規定用數字表示的月。 day 可選。規定天。 year 可選。規定年。在某些系統上,合法值介於 1901 &