Time of Update: 2017-01-13
GD庫,是php處理圖形的擴充庫,GD庫提供了一系列用來處理圖片的API,使用GD庫可以處理圖片,或者產生圖片。 在網站上GD庫通常用來產生縮圖,或者用來對圖片加浮水印,或者用來產生漢字驗證碼,或者對網站資料產生報表等。 產生效果圖:GD庫的安裝什麼的網上都有,現在很多虛擬空間也都支援,這裡就不再贅述。下面通過我實際應用代碼的執行個體和相關的注釋為大家介紹一下GD庫的使用方法。 代碼如下複製代碼 $str="北京"; $str2=
Time of Update: 2017-01-13
php_imagick什麼一個可以供PHP調用ImageMagick功能的PHP擴充。使用這個擴充可以使PHP具備和ImageMagick相同的功能。ImageMagick是一套功能強大、穩定而且免費的工具集和開發包,可以用來讀、寫和處理超過185種基本格式的圖片檔案,包括流行的TIFF, JPEG, GIF, PNG, PDF以及PhotoCD等格式。利用ImageMagick,你可以根據web應用程式的需要動態產生圖片,
Time of Update: 2017-01-13
•建立一個PHP檔案captcha_code_file.php 代碼如下複製代碼 //首先開啟sessionsession_start();//定義前台顯示驗證碼長&寬$image_width = 120;$image_height = 40;$characters_on_image = 6;$font = './monofont.ttf';//The characters that can be used in the CAPTCHA
Time of Update: 2017-01-13
1、XML,Extensible Markup Language(可延伸標記語言 (XML)),是一種可以建立自訂標籤符號(Tags)的標記語言,是用於表示結構化資訊的一種標準文字格式設定,作為下一代資料交換格式的標準。和HTML一樣,XML基於標準通用標記語言 (SGML)(Standard Generalized Markup
Time of Update: 2017-01-13
先看一個把數群組轉換xml 代碼如下複製代碼 function array2xml($array, $xml = false){ if($xml === false){ $xml = new SimpleXMLElement('<root/>'); }
Time of Update: 2017-01-13
例,產生xml文檔 代碼如下複製代碼 class SimpleXMLExtended extends SimpleXMLElement { public function addCData($cdata_text) { $node = dom_import_simplexml($this); $no = $node->ownerDocument;
Time of Update: 2017-01-13
入門級simple_html_dom外掛程式用dom處理html檔案的利器使用:載入simple_html_dom.php檔案require_once 'simple_html_dom.php'new simple_html_dom對象$dom = new simple_html_dom()載入html$dom->load($html);find()方法$dom->find('div.lookLeftname',
Time of Update: 2017-01-13
產生XML格式資料我們假設系統中有一張學生資訊表student,需要提供給第三方調用,並有id,name,sex,age分別記錄學生的姓名、性別、年齡等資訊。 代碼如下複製代碼
Time of Update: 2017-01-13
先看xml文檔 代碼如下複製代碼 <?xml version="1.0" encoding="utf-8"?><article> <item> <title size="1">title1</title>
Time of Update: 2017-01-13
//備份還原函數 代碼如下複製代碼 function write_file($sql,$filename) { $re=true; if(!@$fp=fopen("./www.111cn.net/".$filename,"w+")) {$re=false; echo "failed to open target
Time of Update: 2017-01-13
require_once 'excel/reader.php';// excelfile($filename, $encoding);$data = new spreadsheet_excel_reader();// set output encoding.$data->setoutputencoding('cp1251');$data->read('jxlrwtest.xls');error_reporting(e_all ^ e_notice);for ($i = 1; $i &
Time of Update: 2017-01-13
這是一款實用的php教程利用excelfileparser把excel匯入資料庫教程哦。 代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.111cn.
Time of Update: 2017-01-13
很多伺服器對於中文檔案名稱支援不是很好,有沒有好的辦法來解決呢???現在的解決方案一般是產生一個ID,將這個ID做檔案名稱;網頁上如果url帶漢字也經常出錯;現在的解決方案一般用urlencode編碼 現在用了這個轉化,就好多了 原理:利用多維陣列 1.添加索引 2.遍曆數組 <? $d=array( array("a",-20319), array("ai",-20317), array("an",-20304), array(
Time of Update: 2017-01-13
曾幾何時,php之火在中國的大地燃燒,那熊熊烈火,至今也不因 .net 而熄滅!有理由相信,php 的高效運行效率,它的豐富免費資料,可以讓它繼續生存。 介紹 php 又怎麼會忘記 php 的老換檔 mysql 資料庫呢,此兩者常常成雙成對,出雙入對,就像影子一樣,你不離開我,我不離開你! 小編輯為此整理了下面的專題教程,為 php 入門者提供方便。php PHP入門速成 PHP的安裝 變數的變數,PHP 和
Time of Update: 2017-01-13
以下是一個風格類似windows資源管理員的樹型菜單 將下面的指令碼包含到你的頁面中 另外需要從資源管理員中截取一些gif圖片,祥見指令碼中的注釋 菜單結構檔案的格式為: tree level|item text|item link|link target|last item in subtree 例如 .<b>Demo menu</b>|javascript: alert('This is the demo menu for TreeMenu 1.0'); ..<
Time of Update: 2017-01-13
<?php //公用函數 //把角度轉換為弧度 function deg2Arc($degrees) { return($degrees * (pi()/180.0)); } //RGB function getRGB($color){ $R=($color>>16) & 0xff; $G=($color>>8) & 0xff; $B=($color) & 0xff; return (array($R,$G,$B)); } /
Time of Update: 2017-01-13
我們構建注入語句吧 在輸入框輸入 a% and 1=2 union select 1,username,3,4,5,6,7,8, password,10,11 from alphaauthor#放到sql語句中成了 select * from alphadb where title like %a% and 1=2 union select 1,username,3,4,5,6,7,8, password,10,11 from alphaauthor# % 結果如圖17哦
Time of Update: 2017-01-13
新聞檔案以文字檔.txt的格式存放在一個固定的目錄下,新聞的發布可以自動完成。該過程由兩部分組成: 第一是新聞的顯示,由shownews.php指令碼實現,代碼如下: 〈table border="0" width="90%"〉 〈?php //在新聞檔案中的第一行放新聞的標題 //新聞檔案必須是文字檔(.txt) $newspath = "./news/"; // 修改新聞檔案存放的目錄 $newsfile = array(); $hd = dir($newspath); while(
Time of Update: 2017-01-13
如果沒有準備包我們可以去PHP5.2.17 官方下載: http://windows.php.net/downloads/releases/php-5.2.17-Win32-VC6-x86.zipPHP5.3.5 官方下載:http://windows.php.net/downloads/releases/php-5.3.5-Win32-VC9-x86.zip首先安裝好IIS7 安裝的時候 要注意三個地方打得勾 注: CGI 會在IIS7+PHP_5
Time of Update: 2017-01-13
安裝Xdebugwget http://xdebug.org/files/xdebug-2.2.7.tgztar zxvf xdebug-2.2.7.tgzcd xdebug-2.2.7phpize./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-configmakemake install編譯完成接下來修改php.ini配置, 在次之前你也可以先去 你的 php 安裝路徑下的lib