Time of Update: 2018-12-04
<?php //輸出當前的時期 echo "輸出從格林威治到現在的秒數:".time()."<hr/>"; //設定預設的時區為中國 date_default_timezone_set("PRC"); //日期輸出的格式 echo date("Y-m-d
Time of Update: 2018-12-04
php中的存取修飾詞的學習:執行個體:<?php //php存取修飾詞 class Person{ //名字 public $name; //年齡 protected $age; //工資薪水 private $xinshui; //person類的構造方法 public function __construct($name,$age,$xinshui){ $this->name=$name; $this->age=$age;
Time of Update: 2018-12-04
<?php//父類 class Stu{ public $name; protected $age;protected $grade;public function showInfo(){ echo $this->name;} } //子類 class Pupil extends Stu{ public function testing(){ echo "小學生考試......";} } //子類 class Graduate
Time of Update: 2018-12-04
<?php //研究一個類繼承另一個類的時候,究竟是什麼東西是可以繼承的。 class A{ //父類的公開屬性 public $name="聶小倩"; //父類的受保護的屬性 protected $age="20"; //父類的私人的屬性 private $sex; //父類的公開的方法 public function testing1(){ echo "test1()";} //父類的受保護的方法 protected
Time of Update: 2018-12-04
1.http協議是建立在TCP/IP協議上面的。2.http中文意思:超文本協議。3.http請求基本結構:請求行、訊息頭,訊息體(實體內容)4.列印伺服器訊息頭的詳細資料。$_SERVER5.在伺服器端,我們可以通過一個數組:$_SERVER來擷取任意一個數組其中的資訊。 比較常見的有:HTTP_HOST REMOTE_ADDR(訪問該頁面的IP)
Time of Update: 2018-12-04
StringUtil.javapackage com.lh.bean;public class StringUtil {// 轉換前的int值private int intValue = 0;// 轉換後的字串1值private String strValue1;// 轉換後的字串2值private String strValue2;// 轉換後的字串3值private String strValue3;// 預設構造方法public StringUtil() {}public String
Time of Update: 2018-12-04
<?php //自訂函數 function my_error3($errno,$errmes){ //設定預設的時區為中國 date_default_timezone_set("PRC"); //日期輸出的格式 $date=date("Y-m-d G:i:s"); $err_info="錯誤號碼是:".$errno."--".$errmes."====日期是:".$date; echo $err_info; //把這個錯誤的資訊儲存
Time of Update: 2018-12-04
StringUtil.javapackage com.lh.bean;import java.text.NumberFormat;public class StringUtil {// 定義要格式化的整型值private int intValue;// 格式化後的字串private String formatStr;// 格式化後字串的最少位元private int minimumDigit;// 預設的構造方法public StringUtil() {}public int
Time of Update: 2018-12-04
繼承的細節問題:1.子類繼承父類之後,子類在執行個體化對象的時候,不會調用父類的構造方法,只會調用子類的構造方法。2.如果子類要訪問父類的構造方法,可以使用 父類:: __construct()或者是parent::__construct3.java的子類在建立對象的時候,會同時的調用父類的構造方法。<?php//繼承的細節問題 class C{ public function __construct(){ echo "我是父類的構造方法<br/>"; }
Time of Update: 2018-12-04
<?php //php數組的注意細節,如果前面是3,後面的索引就是4,5 //如該執行個體中直接就能將下標為5的值lisi取出來。 $name=Array("3"=>"logo","zhangsan","lisi"); echo $name[5];?>2.使用true和false作為下標的名稱:則true為1,false為0.3.如果是用null作為下標的名稱:則可以使用
Time of Update: 2018-12-04
<html> <head> <title> New Document </title> <style> p.cls1{ color:red;}p.cls2{ color:green; } </style> </head> <body> <p class="cls2">hello,world</p> <p
Time of Update: 2018-12-04
<?php//使用unset函數釋放數組中的某一個資源,刪除後其他的下標是不變的。 /*$array[1]="aaa"; $array[2]="bbb"; $array[3]="ccc"; echo "刪除前******<br/>".$array[2]."<br/>"; unset($array[2]); echo "刪除後******<br/>".$array[2]."<br/>";*/ //數組運算子+
Time of Update: 2018-12-04
StringUtil.javapackage com.lh.bean;public class StringUtil {// 源字串private String sourceStr;// 替換後的字串private String targetStr;public String getSourceStr() {return sourceStr;}public void setSourceStr(String sourceStr) {this.sourceStr =
Time of Update: 2018-12-04
StringUtil.javapackage com.lh.bean;public class StringUtil {// 源字串private String sourceStr;// 過濾後的字串private String targetStr;public String getSourceStr() {return sourceStr;}public void setSourceStr(String sourceStr) {this.sourceStr =
Time of Update: 2018-12-04
<?php //沒有防止盜鏈。 if(isset($_SERVER['HTTP_REFERER'])){ //取出來 //判斷$_SERVER['HTTP_REFERER']是不是以http://localhost/http 開始函數 if(strpos($_SERVER['HTTP_REFERER'],"http://localhost/http")==0){ echo "查看重要訊息........"; }else{
Time of Update: 2018-12-04
myView.php<html><head><title>線上詞典</title><meta http-equiv="content-type" content="text/html;charset=utf-8"/></head><h1>查詢英文</h1><form action="wordProcess.php" method="post">請輸入英文:<input
Time of Update: 2018-12-04
StringUtil.javapackage com.lh.bean;public class StringUtil {// 指定開頭的字串private String startStr;// 被判斷的字串private String str = "";// 判斷結果private boolean check;public String getStartStr() {return startStr;}public void setStartStr(String startStr)
Time of Update: 2018-12-04
<?php //介面和繼承類的區別。 //1.繼承是層級的關係,如果一個繼承中的某一層修改,就會打破這個繼承平衡。 //2.介面靈活,是繼承的一種擴充。 //舉例說明:小猴子繼承大猴子,只會有爬樹能力,如果實現介面,會具有飛翔,有用等能力。 class Monkey{ public function climbing(){ echo "猴子會爬樹。。。。<br/>"; } } interface iFishable{
Time of Update: 2018-12-04
mainView.php<html><head><title>線上詞典</title><meta http-equiv="content-type" content="text/html;charset=utf-8"/></head><h1>查詢英文</h1><form action="wordProcess.php" method="post">請輸入英文:<input type=
Time of Update: 2018-12-04
<?php header("Content-type:text/html;charset=utf-8"); //mysqli操作mysql資料庫(物件導向) //1.建立mysqli對象 $mysqli=new Mysqli("localhost","root","root","worddb"); //驗證是否ok if($mysqli->connect_error){ die("串連失敗".$mysqli->connect_error); }else{