==========字元處理函數=============
SQL語句保留字元轉義
long get_magic_quotes_gpc(void)
string addslashes ( string str )
string stripslashes(string str)
字元的ASCII碼
int ord(string string) 十進位
string chr(ascii) 十進位 八進位(0) 十六進位(0x)
string base_convert(string $number,int $frombase,int $tobase)
清理字串空格
string trim(string,charlist) charlist,可選
string rtrim(string,charlist)
string ltrim(string,charlist)
改變字母大小寫
string strtolower(string $str)
string strtoupper(string $str)
string ucfirst(string $str)
string ucwords(string $str)
截取字串
array explode(separator,string,limit) limit,可選,返回的數組元素的最大數目
string substr(string,start,length)
int strlen(string)
string strstr(string,search) 大小寫敏感
string stristr(string,search)
string str_repeat(string,repeat)
字串尋找
int strpos(string,find,start) start,可選
int substr_count(string,substring,start,length) start,length,可選
string str_replace(find,replace,string,count) count,可選。
string strrev(string $string) 字元翻轉,限一個位元組字元
html處理
string htmlspecialchars(string,quotestyle,character-set) quotestyle,character-set,可選。
htmlentities("
我愛你
",ENT_COMPAT,"GB2312")
string htmlspecialchars_decode(string,quotestyle,character-set)
string htmlentities(string,quotestyle,character-set)
string html_entity_decode(string,quotestyle,character-set)
string strip_tags(string $str[,string $allowable_tags])
日期時間[Y-m-d H:i:s]
-----------------------------------
php 設定時區
1.代片斷聲明
date_default_timezone_set (PRC);
2.php.ini定義
date.timezone = "PRC"
-----------------------------------
double time(void)
float microtime(get_as_float) get_as_float,可選
string date(format,timestamp) timestamp,可選
array getdate(timestamp)
double mktime(hour,minute,second,month,day,year,is_dst)
array gettimeofday(return_float) return_float,可選,返回一個秒與微秒等時間資訊的數組
URL處理
array parse_url(string $url(,int $component = -1])
string urlencode(string $str)
string urldecode(string $str)
擷取PHP環境擴充與啟用函數庫
array get_loaded_extensions([bool $zend_extensions = false])
array get_extension_funcs(string $module_name)
PRECRegex
int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )
int preg_match_all ( string pattern, string subject, array matches [, int flags] )
mixed preg_replace ( mixed pattern, mixed replacement, mixed subject [, int limit] )
mysqli相關類
--mysqli類 PHP 和 MySQL 資料庫之間的串連
---建構函式
---mysqli(host,user,pass,db)
---方法
---set_charset(gbk)
---character_set_name()
---select_db(db)
---query(sql)
---prepare(sql) sql:insert into table values(?,?)
---close()
---屬性
---affected_rows
---error
--mysqli result類
---方法
---fetch_array()
---close()
---屬性
---num_rows
--mysqli stmt類
---方法
---bind_param(type,var...)
---execute()
---close()
---屬性
---affected_rows
---error
---num_rows
---field_count select統計屬性
http://www.bkjia.com/PHPjc/478744.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478744.htmlTechArticle==========字元處理函數============= SQL語句保留字元轉義 long get_magic_quotes_gpc(void) string addslashes ( string str ) string stripslashes(string str) 字元的ASCI...