PHP Common function Object _php Tutorial

Source: Internet
Author: User
========== Character processing function =============
SQL statement reserved character escapes
Long get_magic_quotes_gpc (void)
String addslashes (String str)
String stripslashes (String str)
ASCII code for characters
int ord (string string) decimal
String Chr (ASCII) decimal octal (0) hex (0x)
String Base_convert (string $number, int $frombase, int $tobase)
Clean up string spaces
String Trim (string,charlist) charlist, optional
String RTrim (String,charlist)
String LTrim (String,charlist)
Change Letter Case
String Strtolower (String $str)
String Strtoupper (String $str)
String Ucfirst (String $str)
String Ucwords (String $str)
Intercept string
Array explode (separator,string,limit) limit, optional, maximum number of array elements returned
String substr (String,start,length)
int strlen (String)
String Strstr (String,search) Case sensitive
String Stristr (String,search)
String Str_repeat (String,repeat)
String Lookup
int Strpos (string,find,start) Start, optional
int Substr_count (string,substring,start,length) start,length, optional
String Str_replace (Find,replace,string,count) count, optional.
String Strrev (string $string) character flipped with a limit of one byte character
HTML processing
String Htmlspecialchars (String,quotestyle,character-set) quotestyle,character-set, optional.
Htmlentities ("

I love you

", 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])
Date time [y-m-d h:i:s]

-----------------------------------

PHP Set time zone
1. Generation of pieces Declaration
Date_default_timezone_set (PRC);
2.php.ini definition
Date.timezone = "PRC"

-----------------------------------
Double Time (void)
Float Microtime (get_as_float) get_as_float, optional
String Date (Format,timestamp) timestamp, optional
Array getdate (timestamp)
Double Mktime (HOUR,MINUTE,SECOND,MONTH,DAY,YEAR,IS_DST)
Array Gettimeofday (return_float) return_float, optionally, returns a second and a microsecond of time information
URL Handling
Array Parse_url (string $url (, int $component =-1])
String UrlEncode (String $str)
String UrlDecode (String $str)
Get the PHP Environment extension and enable function library
Array get_loaded_extensions ([bool $zend _extensions = false])
Array Get_extension_funcs (string $module _name)
Prec Regular Expressions
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 related Classes
Connection between the--mysqli class PHP and the MySQL database
---constructors
---mysqli (host,user,pass,db)
---method
---set_charset (GBK)
---character_set_name ()
---select_db (db)
---query (SQL)
---prepare (SQL) Sql:insert into table values (?,?)
---close ()
---properties
---affected_rows
---error


--mysqli Result Class
---method
---fetch_array ()
---close ()
---properties
---num_rows


--mysqli stmt Class
---method
---bind_param (type,var ...)
---execute ()
---close ()
---properties
---affected_rows
---error
---num_rows
---field_count Select statistics Properties

http://www.bkjia.com/PHPjc/478744.html www.bkjia.com true http://www.bkjia.com/PHPjc/478744.html techarticle ========== character handling function ============= SQL statement reserved character escape long get_magic_quotes_gpc (void) string addslashes (String str) string str Ipslashes (String str) character of ASci ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.