Time of Update: 2016-07-25
突然有感而發,小小抒情一下,順便緬懷一下過去。初春,柳芽點點翠綠欣欣向榮,燕子口銜春泥在天空飛翔;夏末,青苹果在烈陽的照耀下,已漸漸泛紅,偶爾驚雷陣陣,在大雨的洗刷下,顯得格外晶瑩剔透;秋分,金色的落葉,北雁南飛,連綿的秋雨洗刷著夏天的炎熱;冬季,雪花滿天飛舞,伴隨著凜冽的寒風,塑造了一個白妝素裹的世界。一年的四季輪迴就在你數行代碼,便能呈現的淋漓盡致,栩栩如生,如此的巧妙的你,讓我怎能不驚奇,讓我怎能不愛你。雖然你是用西方的英語來編寫的,但語言優雅細緻卻與語文有異曲同工之妙,看篇好的文章能夠增
Time of Update: 2016-07-25
/** php 檢測遠端檔案是否存在 by http://bbs.it-home.org*/function get_http_response_code($theURL) { $headers = get_headers($theURL); return substr($headers[0], 9, 3); } /** * Fetches all the real headers sent by the server in response to a HTTP
Time of Update: 2016-07-25
冬棗,冬甘蔗,冬瓜
Time of Update: 2016-07-25
//檢測檔案類型//by http://bbs.it-home.orgfunction checkFileType($filename){ //檔案頭 $_typecode = array( '3780',//PDF '8075',//.docx,.xlsx,.pptx,.potx,.vsdx,.odt '208207',//.doc,.xls,.ppt,.vsd,.pot,.wps,.dps,.et );
Time of Update: 2016-07-25
學東西容易。化為己有難。新手程式員發現自己在最近的幾個項目中偷竊了其它項目的思想。當然,並不是真正的“偷”,而是瀏覽和學習你欣賞的項目和開發人員,從中竊取思想。諸如設計模式,重構方法等。Chris是如何處理hub裡的命令列參數的?shell指令碼和rvm上的Ruby是如何進行韋恩轉化的?當你遇到問題,有點難度、需要你動一下腦子時,你要問“嗨,我怎麼實現這個呢?”,這是個不錯的問題入手點。
Time of Update: 2016-07-25
php檔案上傳的簡單例子,擷取檔案名稱、類型、大小等相關資訊,完成檔案的上傳,供大家學習參考。1、上傳檔案的代碼: m.jpg [type] => image/jpeg [tmp_name] => C:\WINDOWS\Temp\php1A.tmp [error] => 0 [size] => 44905
Time of Update: 2016-07-25
$dir = $_SERVER['DOCUMENT_ROOT'];$dir = "$dir/files/";$d = opendir($dir);while(false !==($f=readdir($d))){if(is_file($f)){echo " $f ";}else{echo " 是目錄$f
Time of Update: 2016-07-25
用於示範PHP header()函數用法的代碼,介紹了refresh方法,老外寫的,當然不會太差,有需要的朋友參考下吧。php header頭資訊的例子。// override X-Powered-By: PHP:header('X-Powered-By: PHP/4.4.0');header('X-Powered-By: Brain/0.6b');// content language (en = English)header('Content-language: en');// last
Time of Update: 2016-07-25
//取檔案尾碼名//by bbs.it-home.org$file_name = "jbxue.com.txt";echo get_exname($file_name); /** * 擷取副檔名 * @param unknown_type $file_name * @return $ex_name */ function get_exname($file_name){ if(empty($file_name)) return false;
Time of Update: 2016-07-25
var_dump(is_file('a_file.txt')) . "\n";var_dump(is_file('/usr/bin/')) . "\n";?> 複製代碼輸出:bool(true)bool(false)例2: function isfile($file){return preg_match('/^[^.^:^?^-][^:^?]*.(?i)' . getexts() . '$/',$file);//first character cannot be . : ? -
Time of Update: 2016-07-25
//檢測檔案類型$filename = "11.jpg";//圖片的路徑$file = fopen($filename, "rb");$bin = fread($file, 2); //唯讀2位元組fclose($file);$strInfo = @unpack("C2chars", $bin);$typeCode = intval($strInfo['chars1'].$strInfo['chars2']);$fileType = '';switch ($typeCode) {case 779
Time of Update: 2016-07-25
//取檔案的副檔名//by http://bbs.it-home.org$file = "/home/jbxue/file_20130322.txt";for($i=1; $i $func = 'get_file_ext_' . $i;var_dump($func($file));}function get_file_ext_1($file) {return strtolower(trim(substr(strrchr($file, '.'), 1)));}function
Time of Update: 2016-07-25
php代碼擷取電腦的唯一標識資訊,包括cpu資訊、網卡資訊與MAC地址資訊,有需要的朋友,可以參考下。擷取CPU、網卡、MAC地址資訊的代碼。您可能感興趣的文章:PHP擷取MAC地址的實現代碼php擷取電腦MAC地址的代碼舉例php取用戶端MAC地址什麼是MAC地址-基礎知識php擷取網卡MAC地址與URL中主域
Time of Update: 2016-07-25
$url = 'http://xxxx.com'; $hander_array = get_headers ( $url ); if ($header_array [0] == 'HTTP/1.1 200 OK') { echo '檔案存在'; } else { echo '檔案不存在'; } 複製代碼說明:get_headers
Time of Update: 2016-07-25
var_dump(is_dir('a_file.txt')) . "\n";var_dump(is_dir('bogus_dir/abc')) . "\n";var_dump(is_dir('..')); //one dir up?> 複製代碼輸出:bool(false)bool(false)bool(true)例2: $file = "images";if(is_dir($file)){echo ("$file is a directory");}else{echo ("$file is
Time of Update: 2016-07-25
/*擷取檔案的副檔名用法:GetFiletype($filename)*/function GetFiletype($Filename) {if (substr_count($Filename, ".") == 0) { // 檢查檔案名稱中是否有.號。 return; // 返回空} else if (substr($Filename, -1) == ".") { // 檢查是否以.結尾,即無副檔名 return; // 返回空} else { $FileType =
Time of Update: 2016-07-25
//取檔案的副檔名//by http://bbs.it-home.org//method 1function get_file_ext_1($fileName){ $retval=""; $pt=strtpos($fileName,"."); if($pt){ $retval=substr($fileName,$pt+1,strlen($fileName)-$pt); } if($retval!==""){
Time of Update: 2016-07-25
php limit 翻頁代碼,有需要的朋友參考下。省略了資料庫操作部分,唯寫分頁代碼。$display=10;//每頁記錄數if (isset($_GET["p"])){ $num_pages=$_GET["p"];//當前頁碼}else{ $sql="select count(*) from f_user"; $rs=@mysql_query($sql) or die(mysql_error()); $row=mysql_fetch_array($rs); $num_records=$row[
Time of Update: 2016-07-25
//二維數組 按索引值 排序function array_sort($array,$keys,$type='desc'){if(!isset($array) || !is_array($array) || empty($array)){return '';}if(!isset($keys) || trim($keys)==''){return '';}if(!isset($type) || $type=='' || !in_array(strtolower($type),array('asc',
Time of Update: 2016-07-25
為大家介紹一下php中的三個檔案或目錄判斷函數:file_exists、is_dir、is_file的區別,有興趣的朋友,可以瞭解下。有人這樣說,PHP的 file_exists = is_dir + is_file,呵呵,為什麼這樣說類?file_exists函數既可以判斷檔案是否存在,又可以判斷目錄是否存在。不過它的執行效率非常低,就像asp中request不指定是form,還是get,cookies,所以,聰明的你,一定可以順暢理解下面的總結:1、如果要判斷目錄是否存在,請用獨立函數