16-日期的輸出

<?php //輸出當前的時期 echo "輸出從格林威治到現在的秒數:".time()."<hr/>"; //設定預設的時區為中國 date_default_timezone_set("PRC"); //日期輸出的格式 echo date("Y-m-d

01-存取修飾詞-封裝

php中的存取修飾詞的學習:執行個體:<?php //php存取修飾詞 class Person{ //名字 public $name; //年齡 protected $age; //工資薪水 private $xinshui; //person類的構造方法 public function __construct($name,$age,$xinshui){ $this->name=$name; $this->age=$age;

02-繼承執行個體

<?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

03-子類可以繼承父類的什嗎?

<?php //研究一個類繼承另一個類的時候,究竟是什麼東西是可以繼承的。 class A{ //父類的公開屬性 public $name="聶小倩"; //父類的受保護的屬性 protected $age="20"; //父類的私人的屬性 private $sex; //父類的公開的方法 public function testing1(){ echo "test1()";} //父類的受保護的方法 protected

01-http訊息頭剖析-http協議

1.http協議是建立在TCP/IP協議上面的。2.http中文意思:超文本協議。3.http請求基本結構:請求行、訊息頭,訊息體(實體內容)4.列印伺服器訊息頭的詳細資料。$_SERVER5.在伺服器端,我們可以通過一個數組:$_SERVER來擷取任意一個數組其中的資訊。  比較常見的有:HTTP_HOST                REMOTE_ADDR(訪問該頁面的IP)               

06-將整型值轉換為字串(字串處理)

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

17-錯誤記錄檔

<?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; //把這個錯誤的資訊儲存

08-把整型資料格式化為指定長度的字串(字串處理)

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

04-繼承的細節問題

繼承的細節問題:1.子類繼承父類之後,子類在執行個體化對象的時候,不會調用父類的構造方法,只會調用子類的構造方法。2.如果子類要訪問父類的構造方法,可以使用 父類:: __construct()或者是parent::__construct3.java的子類在建立對象的時候,會同時的調用父類的構造方法。<?php//繼承的細節問題 class C{ public function __construct(){ echo "我是父類的構造方法<br/>"; }

25-數組細節問題1

<?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作為下標的名稱:則可以使用    

30-同一html元素分類控制、萬用字元選取器、選取器優先順序、margin知識

<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

26-數組細節問題2

<?php//使用unset函數釋放數組中的某一個資源,刪除後其他的下標是不變的。 /*$array[1]="aaa"; $array[2]="bbb"; $array[3]="ccc"; echo "刪除前******<br/>".$array[2]."<br/>"; unset($array[2]); echo "刪除後******<br/>".$array[2]."<br/>";*/ //數組運算子+

10-過濾輸入字串中的危險字元(字串處理)

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 =

11-過濾字串中的空格和null值(字串處理)

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 =

05-防盜鏈技術

<?php //沒有防止盜鏈。 if(isset($_SERVER['HTTP_REFERER'])){ //取出來 //判斷$_SERVER['HTTP_REFERER']是不是以http://localhost/http 開始函數 if(strpos($_SERVER['HTTP_REFERER'],"http://localhost/http")==0){ echo "查看重要訊息........"; }else{

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

12-判斷字串是否以指定字元開頭(資料驗證)

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)

10-介面和繼承類的區別

<?php //介面和繼承類的區別。 //1.繼承是層級的關係,如果一個繼承中的某一層修改,就會打破這個繼承平衡。 //2.介面靈活,是繼承的一種擴充。 //舉例說明:小猴子繼承大猴子,只會有爬樹能力,如果實現介面,會具有飛翔,有用等能力。 class Monkey{ public function climbing(){ echo "猴子會爬樹。。。。<br/>"; } } interface iFishable{

05-線上小詞典案例2—中文尋找英文

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=

06-物件導向,使用mysqli遍曆資料庫

<?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{

總頁數: 61357 1 .... 17613 17614 17615 17616 17617 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.