Time of Update: 2017-01-13
代碼如下複製代碼 <html xmlns="http://www.111cn.net/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=gb2312"
Time of Update: 2017-01-13
//執行個體一 代碼如下複製代碼 $string="i am abc"; if (ereg ("www.111cn.net", $string)) echo "'abc' is true
Time of Update: 2017-01-13
代碼如下複製代碼 $date="2003-01-31"; if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs))
Time of Update: 2017-01-13
代碼如下複製代碼 error_reporting(0);$mysql_servername = "localhost"; $mysql_username = "root"; $mysql_password =""; $mysql_database ="peng"; mysql_connect($mysql_servername ,
Time of Update: 2017-01-13
//截取字串mb_substr($str,star,count,encode);//擷取字串長度mb_strlen();//完整保留在textarea文本中的斷行符號換行str_replace(chr(10),"<br />",$textarea);//根據ascii返回相應的字母echo "ascii為66的字母是:". chr(66)."<br>";//chop
Time of Update: 2017-01-13
//字串截取函數一 代碼如下複製代碼 function mystr($str,$str_len) {//剪取一定長度的字串(字串,剪取長度) if (strlen($str)<=$str_len) { return $str; }else return mysubstr($str,
Time of Update: 2017-01-13
代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-
Time of Update: 2017-01-13
代碼如下複製代碼 function pagenavi($total, $offset){ global $conf_pagemax; global $conf_home; global $conf_pastlog; global $view; $next = $offset + $conf_pagemax; $prev = $offset - $conf_pagemax; echo "
Time of Update: 2017-01-13
//fopen 讀取檔案執行個體 代碼如下 複製代碼 $path ='a.txt'; $fp=fopen($file,"r");//以唯讀方式開啟檔案 while(!(feof($fp))) { $text=fgets($
Time of Update: 2017-01-13
代碼如下複製代碼 <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-
Time of Update: 2017-01-13
代碼如下複製代碼 $uid = $_request['uid'];checkusername($uid);function checkusername(){ $title = $uid; if( empty( $title ) ) { return
Time of Update: 2017-01-13
代碼如下複製代碼 /*—————————————————— */ //– 遞迴刪除檔案及目錄 //– 例: del_dir ('../www.1111cn.net/');注意:返回的/是必須的 //– $type 強制移除目錄,
Time of Update: 2017-01-13
代碼如下複製代碼 <?php $fruits = array ( "fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), "numbers" => array(1, 2, 3, 4, 5, 6),
Time of Update: 2017-01-13
//最簡單的方法 代碼如下複製代碼 $ip = $_server["remote_addr"];echo $ip; //最實用擷取使用者ip地址代碼 代碼如下複製代碼 function get_real_ip() {
Time of Update: 2017-01-13
代碼如下複製代碼 class getmacaddr{ var $return_array = array(); // 返回帶有mac地址的字串數組 var $mac_addr;
Time of Update: 2017-01-13
代碼如下複製代碼 $dir = "d: iles";$file_list1 = scandir($dir);//向函數scandir傳入第2個參數,如果第2個參數為1,表示按字母降序排列檔案名稱$file_list2 = scandir($dir,1);echo "<pre>";print_r($file_list1);print_r($file_list2); //改變目錄 代碼如下複製代碼 echo
Time of Update: 2017-01-13
<html><head><title>php 檔案上傳簡單一實例應用</title></head><body> 代碼如下複製代碼 <!-- 表單的enctype屬性必須指定為multipart/form-data --><form enctype="multipart/form-data" action="3.php"
Time of Update: 2017-01-13
代碼如下複製代碼 <form name="form1" enctype="multipart/form-data" method="post" action=""> <label for="filefield"></label> <input type="file"
Time of Update: 2017-01-13
代碼如下複製代碼 $str = 'ht<td align=right> <a href=http://www.111cn.net/>第一頁</a> & nbsp; <a href=http://down.111cn.net/index_2.html>上一頁</a> & nbsp; <a
Time of Update: 2017-01-13
代碼如下複製代碼 function page($sql,$pagesize=10,$class=""){ if(!is_string($sql)){ return 0;exit;} $result=mysql教程_query($sql); if(!$result){return 0;exit;} if(!$recordnum=mysql_num_rows($result)){return 0;exit;}&