After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:PHP development basic tutorial multi-dimensional array
二維數(shù)組 $arr = array( array(1,2,3), array(1,2,3), array(1,2,3) );
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial date
date() 函數(shù)可把時間戳格式化為可讀性更好的日期和時間 時間戳是一個字符序列,表示一定的事件發(fā)生的日期/時間。 PHP的time()函數(shù)用于返回當前時間的Unix 時間戳 date()格式化日期 d - 代表月中的天 (01 - 31) m - 代表月 (01 - 12) Y - 代表年 (四位數(shù))
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial files include
在PHP中, 有require、require_once、include、include- once四種方法包含一個文件 include 返回一條警告,文件繼續(xù)往下執(zhí)行 include_once 返回一條警告,除了原有的include功能外,如果文件已經(jīng)包含,不在包含 require 返回一個致命的錯誤,代碼不會往下執(zhí)行 require_once 返回一個致命的錯誤,防止文件重復(fù)包含
2016-12-020個贊
Courses in the relevant section:Basic PHP development tutorial: PHP file operations
readfile讀取文件 int readfile ( string $文件名) file_get_contents打開文件 string file_get_contents ( string filename) fopen、fread、fclose操作讀取文件
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial file upload
系統(tǒng)函數(shù)$_FILES PHP為文件類數(shù)據(jù)準備了一個專用的系統(tǒng)函數(shù)$_FILES,上傳文件的所有相關(guān)數(shù)據(jù),都保存在這個系統(tǒng)函數(shù)中
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial - Cookie
setcookie() 函數(shù)用于設(shè)置 cookie setcookie() 函數(shù)必須位于 <html> 標簽之前 // 設(shè)置 cookie 過期時間為過去 1 小時 setcookie("user", "", time()-3600);
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial - Session
session_start(); 開啟session session_destroy(); 銷毀session 存數(shù)據(jù)在session中 $_SESSION['name'] = "值"
2016-12-020個贊
Courses in the relevant section:PHP Development Basics Tutorial: Sending Email
$to = "1264010730@qq.com"; // 郵件接收者 $subject = "參數(shù)郵件"; // 郵件標題 $message = "Hello! 這是郵件的內(nèi)容。"; // 郵件正文 $from = "1264010730@qq.com"; // 郵件發(fā)送者 $headers = "From:" . $from; // 頭部信息設(shè)置 mail($to,$subject,$message,$headers); echo "郵件已發(fā)送";
2016-12-020個贊
Courses in the relevant section:PHP Development Basics Tutorial - Secure E-mail
FILTER_SANITIZE_EMAIL 過濾器從字符串中刪除電子郵件的非法字符 FILTER_VALIDATE_EMAIL 過濾器驗證電子郵件地址的值
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial Error
display_errors 這個選項設(shè)置是否將錯誤信息輸出到網(wǎng)頁,或者對用戶隱藏而不顯示 E_ERROR 錯誤,文件直接中斷,不往下執(zhí)行 E_WARNING 警告,問題比較嚴重,但是會繼續(xù)往下執(zhí)行 E_PARSE 語法錯誤
2016-12-020個贊
Courses in the relevant section:Exception handling in PHP development basic tutorial
需要進行異常處理的代碼應(yīng)該放入 try 代碼塊內(nèi),以便捕獲潛在的異常。 每個 try 或 throw 代碼塊必須至少擁有一個對應(yīng)的 catch 代碼塊。 使用多個 catch 代碼塊可以捕獲不同種類的異常。 可以在 try 代碼塊內(nèi)的 catch 代碼塊中拋出(再次拋出)異常。
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial - filter
filter_var() - 通過一個指定的過濾器來過濾單一的變量 filter_var_array() - 通過相同的或不同的過濾器來過濾多個變量 filter_input - 獲取一個輸入變量,并對它進行過濾 filter_input_array - 獲取多個輸入變量,并通過相同的或不同的過濾器對它們進行過濾
2016-12-020個贊
Courses in the relevant section:PHP Development Basics Tutorial Advanced Filters
$url = "http://ipnx.cn"; if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false) { echo("$url 是一個合法的 URL"); } else { echo("$url 不是一個合法的 URL"); }
2016-12-020個贊
Courses in the relevant section:PHP development basic tutorial JSON
json_encode() 用于對變量進行 JSON 編碼,該函數(shù)如果執(zhí)行成功返回 JSON 數(shù)據(jù),否則返回 FALSE string json_encode ( $value [, $options = 0 ] ) json_decode() 用于對 JSON 格式的字符串進行解碼,并轉(zhuǎn)換為 PHP 變量。 mixed json_decode ($json [,$assoc = false [, $depth = 512 [, $options = 0 ]]])
2016-12-020個贊
Courses in the relevant section:PHP Development Basics Tutorial - PHP XML Expat Parser
基于樹的解析器:這種解析器把 XML 文檔轉(zhuǎn)換為樹型結(jié)構(gòu)。它分析整篇文檔,并提供了對樹中元素的訪問,例如文檔對象模型 (DOM)。 基于事件的解析器:將 XML 文檔視為一系列的事件。當某個具體的事件發(fā)生時,解析器會調(diào)用函數(shù)來處理。
2016-12-020個贊