Time of Update: 2016-07-25
//$file_path=iconv("utf-8","gb2312","C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\樣本圖片\\完全達到.jpg"); /* if(!copy("C:\\Winter.jpg","D:\\aa.jpg")){ echo "error"; }else{ echo "OK"; } */ //中文要進行轉碼,否則就會報錯
Time of Update: 2016-07-25
/** * php時間 date函數應用 * edit bbs.it-home.org*/echo "今天:".date("Y-m-d")."";echo "昨天:".date("Y-m-d",strtotime("-1 day")), "";echo "明天:".date("Y-m-d",strtotime("+1 day")). "";echo "一周后:".date("Y-m-d",strtotime("+1 week")). "";echo "一周零兩天四小時兩秒後:".date("Y-
Time of Update: 2016-07-25
/* @creates a compressed zip file 將多個檔案壓縮成一個zip檔案的函數 * @$files 數群組類型 執行個體array("1.jpg","2.jpg"); * @destination 目標檔案的路徑 如"c:/androidyue.zip" * @$overwrite 是否為覆蓋與目標檔案相同的檔案 * @site http://bbs.it-home.org */
Time of Update: 2016-07-25
本文介紹下,一份面向php程式員的面試題,附有詳細答案,屬於基礎理論型的內容,有需要的朋友,參考下吧。1、PHP的意思?答:PHP是一個基於服務端來建立**站的指令碼語言,您可以用PHP和HTML產生網站首頁2、談談asp,php,jsp的優缺點?答:ASP全名Active Server Pages,是一個WEB伺服器端的開發環境, 利用它可以產生和運行動態、互動的、高效能的WEB服務應用程式。ASP採用指令碼語言VB Script(Java script)作為自己的開發語言。
Time of Update: 2016-07-25
php程式員面試_bbs.it-home.org 複製代碼a. php $user_name = $_GET['user_name']; $user_tel = $_GET['user_tel']; $user_email = $_GET['user_email']; $user_add = $_GET['user_add']; echo "使用者名稱:$user_name電話:$user_tel郵箱:$user_email地址:$user_add"
Time of Update: 2016-07-25
class dbBackup { public $host='localhost'; //資料庫地址 public $user='root'; //登入名稱 public $pwd=''; //密碼 public $database; //資料庫名 public $charset='utf8'; //資料庫連接編碼:mysql_set_charset}複製代碼二、添加資料庫連接function。 /** * 串連資料庫 .
Time of Update: 2016-07-25
/*** 遍曆目錄,結果存入數組。支援php4及以上。php5以後可用scandir()函數代替while迴圈。* @param string $dir* @return array*/my_scandir($dir){$files = array();if ( $handle = opendir($dir) ){while ( ($file = readdir($handle)) !== false ){if ( $file != ".." && $file != "." ){if ( is_
Time of Update: 2016-07-25
class Cache { /** * $dir : 快取檔案存放目錄 * $lifetime : 快取檔案有效期間,單位為秒 * $cacheid : 快取檔案路徑,包含檔案名稱 * $ext : 快取檔案副檔名(可以不用),這裡使用是為了查看檔案方便 */ private $dir; private $lifetime; private $cacheid; private $ext; /** *
Time of Update: 2016-07-25
登陸系統 session_start(); if ($_SESSION[username]) { ?> }else { ?> } ?> 複製代碼2,config.php $dbhost="localhost"; $dbuser="root"; $dbpassword="123456"; $dbname="auth";
Time of Update: 2016-07-25
本文介紹下,據說是酷訊公司的php程式員面試題,這裡找到了筆記部分,分享一下,供大家參考。專題推薦:php面試題及答案1、有三個php檔案位於同一目錄下,內容為 a.php:-------b.php:-------c.php:-------2、使用瀏覽器訪問 c.php,請問是否存在問題。如果存在問題,請指出修正方法並寫出瀏覽器查看效果如果不存在問題,請寫出瀏覽器查看效果3、從表login中選出name欄位包含admin的前10條結果所有資訊的sql語句4、準確的指出以下代碼的顯示結果
Time of Update: 2016-07-25
class name //建立了一個名為name的類{ private $name; //定義屬性,私人 //定義建構函式,用於初始化賦值 function __construct( $name ) { $this->name = $name; //這裡已經使用了this指標語句① } //解構函式 function __destruct(){} //列印使用者名稱成員函數 function printname()
Time of Update: 2016-07-25
本文介紹下,在linux系統中,用crontab定時執行php程式的方法。有需要的朋友參考下吧。在Linux中使用Crontab定時執行PHP的方法,實現步驟如下:1、使用crontab -e編輯定時任務內容為: xx:xx:xx 執行一個hello.php檔案2、php檔案必須在檔案頭一行,加上解譯器路徑(類似於bash或perl那樣) #!/usr/local/bin/php
Time of Update: 2016-07-25
$a = "joe";$b = "jerry";if ($a != $b){echo "不相等";}else{echo "相等";}?> 複製代碼如果用 !== , === 比較的話,兩個對象的類型要嚴格相等才能返回true;否則用==,!=則會將字串自動轉換成相應的類型,以便進行比較. echo strnatcmp("10.gif", "5.gif"); // 返回 1 (>0)echo strnatcasecmp("10.gif", "5.gif"); // 返回 1 (>0)?>複製代碼&
Time of Update: 2016-07-25
;Translate the image format using the original image size[Translation]width=0height=0;Stretch the image to the specified size[Stretch]width=800height=600;Zoom the image to the specified Width with height auto size[AutoHeight]width=740height=0;Zoom
Time of Update: 2016-07-25
error_reporting(E_ALL ^ E_NOTICE); // 分析 HTTP_ACCEPT_LANGUAGE 的屬性 // 這裡只取第一語言設定 (其他可根據需要增強功能) //搜尋整理 bbs.it-home.org preg_match('/^([a-z\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches); $lang = $matches[1];
Time of Update: 2016-07-25
a=11;if(a>10){ echo "a>10";}複製代碼b、多分支:基本文法: if(條件運算式){ 語句; //.....;}else{ 語句; //.....;}c、多重分支:基本文法: if(條件運算式){ 語句;n個語句;}else if(條件運算式){語句;n個語句;}elseif(條件運算式){語句;n個語句;}eles{語句;n個語句;} 提示:1、else if 可以有一個 也可以有多個。2、最後那個else可以沒有d、switch分支語句
Time of Update: 2016-07-25
$date = "08-30-2010"; //分隔字元可以是斜線,點,或橫線list($month, $day, $year) = split ('[/.-]', $date); //輸出為另一種時間格式echo "今天是:$year 年 $month 月 $day 日";?>複製代碼注意,pattern 是一個Regex,如果想要用的分割字元是Regex中的特殊字元,要先將其轉義。你2,將 /etc/passwd 中的前四個欄位分割出來: 複製代碼如果字串中有 n 個與 pattern
Time of Update: 2016-07-25
$arr1 = array ('0' => array ('fid' => 1, 'tid' => 1, 'name' =>'Name1' ),'1' => array ('fid' => 1, 'tid' => 2 , 'name' =>'Name2' ),'2' => array ('fid' => 1, 'tid' => 5 , 'name' =>'Name3' ),'3' => array ('fid' => 1, 'tid' => 7 , 'name' =>'Name4' ),'4'
Time of Update: 2016-07-25
$str1 = null;$str2 = false;echo $str1==$str2 ? ‘相等’ : ‘不相等’;$str3 = ”;$str4 = 0;echo $str3==$str4 ? ‘相等’ : ‘不相等’;$str5 = 0;$str6 = ’0′;echo $str5===$str6 ? ‘相等’ : ‘不相等’;?>複製代碼2. 寫出如下程式的輸出結果 $a1 = null;$a2 = false;$a3 = 0;$a4 = ”;$a5 = ’0′;$a6 =
Time of Update: 2016-07-25
/*** php 面試題* edit bbs.it-home.org* at 2013-05-13*/functiongbk_strrev($str){//----gbk中文字串翻轉-----$len=strlen($str); for($i=0;$i $char=$str{0}; if(ord($char)>127){ $i++; if($i $arr[]=substr($str,0,2);