Home > Backend Development > PHP Tutorial > [PHP]PHP function

[PHP]PHP function

WBOY
Release: 2016-07-29 09:15:33
Original
816 people have browsed it


String STRING


>> Statistics

strlen(string) - Length

strcmp(string1,string2) - Compare strings

>> Find

str pos( string,find,start) - Search in another string, return the first position

stripos(string,find,start) - (Case insensitive)

strrpos(string,find,start) - (last Once)

strripos(string,find,start) - (Case insensitive)(Last time)

strstr(string,search) - Match in another string, return the first matching value and the remaining part

stristr(string,search) - (case insensitive)

str_replace(find,replace,string,count) - replace

str_ireplace(find,replace,string,count) - (case insensitive)

substr(string,start,length) - intercept

>> Convert

explode(separator,string,limit) - string-> array

implode(separator, array) - array-> character String

join(separator,array) - Same as above

str_split(string,length) - Split the string into an array

parse_str(string,array) - Parse the Query string into an array

strtolower(string) - Lowercase

strtoupper(string) - uppercase

str_shuffle(string) - randomly shuffle

strrev(string) - reverse

>> output

echo(string)

print(string)

printf(format,arg1,arg2,arg++) - Formatted output

fprintf(stream,format,arg1,arg2,arg++) - Formatted output to file

sprintf(format,arg1,arg2,arg++) - Formatted To string

>> format

str_pad(string,length,pad_string,pad_type) - pad to specified length

str_repeat(string,repeat) - repeat specified number of times

chunk_split(string,length,end ) - Insert separator

number_format(number,decimals,decimalpoint,separator) - Format numbers

trim(string,charlist) - Clean both ends

strip_tags(string,allow) - Strip HTML, XML, PHP tags

>> Escape

addslashes(string) - Add backslashes before predefined characters

stripslashes(string)

addcslashes(string,characters) - Add backslashes before custom characters

Stripcslashes(string)

htmlentities(string,quotestyle,character-set) - All characters-> HTML entities

html_entity_decode(string,quotestyle,character-set) - HTML entities-> Characters

htmlspecialchars(string ,quotestyle,character-set) - Partial characters ( & | " | ' | < | > ) -> HTML entity

htmlspecialchars_decode(string,quotestyle) - HTML entity -> Character

nl2br(string) - /n -> ,raw) - Lossy digest of the file

sha1(string,raw) - SHA1 hash

sha1_file(file,raw)

>> ASCII

ord(string) - Returns the ASCII of the first character

Array ARRAY

>> New & Assignment

list(var1,var2,val3...) = $array - assign values ​​to variables using array elements

range(min,max,step) - create Specified range of arrays

array_combine(array1, array2) - Create a new array: array1 is the key, array2 is the value


>> Stack

array_pop(array) - Tail pop

array_push(array, value1, value2. ..) - Push the tail onto the stack, equivalent to $array[] = $value

array_shift(array) - Pop the first part off the stack

array_unshift(array,value1,value2,value3...) - Push the first part onto the stack

> > Statistics

array_sum(array) - the sum of all elements

array_product(array) - the product of all elements

count(array, mode) - counts the number of elements, the same as sizeof(array, mode)

array_count_values( array) - Count the number of occurrences of elements

array_keys(array, value, strict) - Return the corresponding key

array_values(array) - Return all values

array_search(value, array, strict) - Search for value and return the key

in_array(value,array,type) - Check if value exists

array_key_exists(key,array) - Check if key exists

>> Compare

array_diff(array1,array2,array3...) - Difference set

 array_diff_assoc(array1,array2,array3...)

array_diff_key(array1,array2,array3...)

array_intersect(array1,array2,array3...) - Intersection

array_intersect_assoc(array1,array2,array3...)

array_intersect_key(array1,arra y2,array3. ..)

>>Sort

sort(array,sorttype) - sort by value in ascending order (rebuild index)

rsort(array, sorttype) - sort by value in descending order (rebuild index)

asort(array, sorttype) - Forward sorting by value (keep index) arsort(array, sorttype) - Sort reverse by value (keep index)

natsort(array) - Natural sorting

natcasesort(array) - Size-insensitive natural sorting

ksort(array,sorttype) - Forward sorting by key

krsort(array,sorttype) - Reverse sorting by key

array_multisort(array, sorting order, sorting type) - Sorting

shuffle(array) - Randomly sort Random array sorting

array_reverse(array,preserve) - Reverse the order

>> Modify

array_change_key_case(array,case) - Convert case

array_filter(array,function) - Filter with the given method

array_map(function,array1,array2,array3...) - apply method to each element

array_fill(start,number,value) - fill array with given value

array_pad(array,size,value) - put Fill the array to a fixed length

array_flip(array) - exchange key and value

array_unique(array) - remove duplicates

>> merge & split

array_chunk(array,size,preserve_key) - cut

array_rand( array,number) - Randomly return array elements (return key when number=1)

array_slice(array,offset,length,preserve) - Intercept

array_splice(array,offset,length,array) - Replace

array_merge(array1 , array2, array3...) - Merge

array_merge_recursive(array1, array2, array3...) - Recursive merge (when the keys are the same)

>> Pointer

each(array) - Return the current element, and Move the pointer

key(array) - current key

current(array) - current value, same as pos(array)

next(array) - next value

prev(array) - previous value

reset( array) - Move to the beginning

end(array) - Move to the end

Date & Time DATE & TIME


checkdate(month,day,year) - Check the validity of the date

date(format,timestamp) - Formatted output time

>> Information

getdate(timestamp) - Get date & time information array

microtime(get_as_float) - Get current time information array

>> Timestamp

time() - Current time timestamp

strtotime(time,now) - Convert string to timestamp

mktime(hour,minute,second,month,day,year,is_dst) - Get timestamp

Directory DIR


opendir(path,context) - open the directory, return the handle

readdir(handle) - return the file name

closedir(handle) - close the handle

rewinddir(handle) - reset the handle

dir(directory) - Open the directory and return the object. The object has 3 methods: read(), rewind(), close()

File FILE


clearstatcache() - Clear the file cache status

parse_ini_file( file, process_sections) - Parse the ini file and return an array

set_file_buffer(file,buffer) - Set the file output buffer

>> File operation

readfile(filename,include_path,context) - Read the file and output to the buffer

readlink(linkpath)

file(path,include_path,context) - read the file as an array

file_get_contents(path,include_path,context,start,max_length) - read the file into a string

file_put_contents(path,data,mode,context) - write to the file

fopen(filename, mode, include_path,context) - open the file

fgetc(file) - read characters

fgets(file,length) - read One line, or specify the length g FGETCSV (File, Length, SEPAROR, Enclosure) -Chn CSV format, read a line

FPUTS (File, String, LENGTH) -Writing files

FPUTCSV (FILE, FIELDS, Seperator, Encloss) - Write a file in CSV format

fread(file,length) - Read a file

fwrite(file,string,length) - Write a file

fflush(file) - Output the buffer content to a file

ftruncate( file,size) - intercept the file

flock(file,lock,block) - lock the file

ftell(file) - pointer position

fseek(file,offset,whence) - position the pointer

rewind(file) - rewind Set the pointer position

 feof(file) - whether the end of the file is reached

                                                                                                         fstat (()) (     )

>> File status

fstat(file) - file information

 lstat(file) - file/soft link information

fileatime(filename) - last access time

filectime(filename) - on The inode information modification time

filemtime(filename) - the last file content modification time

filegroup(filename) - file user group

fileowner(filename) - file user

fileperms(filename) - file permissions

fileinode( filename) - file inode

filesize(filename) - file size

filetype(filename) - file type

>> path

pathinfo(path,options) - path information

linkinfo(path) - hard link Information

basename(path,suffix) - Get the file name

dirname(path) - Get the directory path

realpath(path) - Get the absolute path

>> Size

disk_total_space(directory) - Get the total space size

disk_free_space(directory) - size of available space

>> Determine

file_exists(path) - whether the file or directory exists

is_dir(path) - directory

is_file(path) - file

is_link(path ) - connection

is_readable(path) - readable

is_writable(path) - writable

is_executable(path) - executable

>> system

mkdir(path,mode,recursive,context)

rmdir(dir,context)

link(target,link)

unlink(filename,context)

copy(source,destination)

rename(oldname,newname,context)

touch (filename, time, atime)

chgrp(filename,group)

chmod(filename,mode)chown(filename,owner)glob(pattern,flags)

>> ; HTTP POST

is_uploaded_file(filename) - Whether the file is uploaded via HTTP POST

move_uploaded_file(filename,newloc) - Move the uploaded file

Errors and exceptions ERROR & EXCEPTION

debug_backtrace() - Generate backtrace associative array

debug_print_backtrace() - Output

error_get_last() - Get the lowest level error


error_log(error, type, destination, headers) - Error log

error_reporting(report_level) - Set the error reporting level

>> Trigger error/throw exception

trigger_error(error_message,error_types) - trigger error

throw new Exception() - throw exception

>> Specify handler function

set_error_handler(error_function,error_types) - error handling function

set_exception_handler(exception_function) - Exception handling function

Filter FILTER

filter_has_var(type, variable) - Whether there is this variable

filter_input(input_type, variable, filter, options) - Filter external input

filter_input_array ( input_type, args)


filter_var(variable, filter, options) - Filter variable

filter_var_array(array, args)

>> Filter

SANITIZE(filter)

FILTER_SANITIZE_STRING - Remove or encode special characters

FILTER_SANITIZE_ENCODED - Similar to urlendode

FILTER_SANITIZE_SPECIAL_CHARS - Similar to urlendode

FILTER_SANITIZE_MAGIC_QUOTES - Similar to addslashes

FILTER_SANITIZE_URL

FILTER_SANITIZ E_EMAIL

FILTER_SANITIZE_NUMBER_INT

FILTER_SANITIZE_NUMBER_FLOAT

VALIDATE(verification)

FILTER_VALIDATE_BOOLEAN

FILTER_VALIDATE_INT

FILTER_VALIDATE_FLOAT

FILTER_VALIDATE_URL

FILTER_VALIDATE_EMAIL

FILTER_VALIDATE_IP

FILTER_VALIDATE_REGEXP

FILTER_CALLBACK - Call custom function

File transfer FTP

>> connection

ftp_connect(host,port,timeout) - Establish a connection

ftp_ssl_connect(host,port ,timeout) - SSL secure connection


ftp_login(ftp_connection,username,password) - Log in to FTP

ftp_raw(ftp_connection,command) - Send command

ftp_exec(ftp_connection,command) - Execute command (after logging in) ftp_pas v(ftp_connection,mode) - whether to be passive Mode

ftp_systype(ftp_connection) - Remote machine system

ftp_get_option(ftp_connection,option) - Get parameters

ftp_set_option(ftp_connection,option,value) - Set options

ftp_close(ftp_connection) - Close the connection, same as ftp_quit()

>> Directory

ftp_mkdir(ftp_connection,dir) - Create a directory

ftp_rmdir(ftp_connection,dir) - Delete the directory

ftp_ch dir(ftp_connection,dir ) - Change directory

ftp_cdup(ftp_connection) - Parent directory

ftp_pwd(ftp_connection) - Current path
ftp_nlist(ftp_connection,dir) - Column directory

ftp_rawlist(ftp_connection,dir,recursive) - Directory list details

& gt; > File

ftp_put(ftp_connection,remote,local,mode,resume) - Upload file

ftp_fput(ftp_connection,remote,local,mode,resume) - Upload local open file

ftp_nb_put(ftp_connection,remote,local,mode ,resume) - Asynchronous upload

ftp_nb_fput(ftp_connection,remote,local,mode,resume) - Asynchronous upload of locally opened files

ftp_get(ftp_connection,local,remote,mode,resume) - Download file ftp_fget(ftp_connection, local,remote,mode,resume) - Download to local open file

ftp_nb_get(ftp_connection,local,remote,mode,resume) - Asynchronous download

ftp_nb_fget(ftp_connection,local,remote,mode,resume) - Asynchronous download to local Open file

ftp_delete(ftp_connection,path) - Delete file

ftp_rename(ftp_connection,from,to) - Rename

ftp_chmod(ftp_connection,mode,file) - Change file permissions

ftp_size(ftp_connection,remote_file) - File size

ftp_mdtm(ftp_connection,file) - File last modification time

HTTP


header(string,replace,http_response_code) - Send HTTP headers

 headers_list() - Header list array

head ers_sent() - Whether the header has been sent

setcookie(name,value,expire,path,domain,secure) - Set Cookie

Math MATH


>> Arithmetic

round() - Rounding

ceil() - Rounding up

floor() - Rounding down

max() - Returning the maximum value

min() - Returning the minimum value

pow(x,y) - x y power

sqrt() - square root

abs() - absolute value

rand(min,max) - return a random integer

>> base

base_convert(number,frombase,tobase) - Arbitrary base conversion

decbin() - Decimal -> Binary

Bindec(binary_string) - Binary -> Decimal

dechex() - Decimal -> Hexadecimal

hexdec() - Ten Hexadecimal-> Decimal

decoct() - Decimal-> Octal

octdec() - Octal-> Decimal

>> Trigonometric function

cos() - Cosine

ac os() - Arccosine

sin() - Sine

asin() - Arcsine

tan() - Tangent

atan() - - Arctangent

MySQL


>> Connection

mysql_connect (server, user, pwd, newlink, clientflag) - connection

mysql_pconnect(server, user, pwd, clientflag) - long connection

mysql_close(connection) - close

>> query

mysql_select_db(database ,connection ) - Select the database

mysql_query(sql) - Execute the query, return the resource handle

mysql_fetch_array(data,array_type) - Query, return the array

mysql_fetch_assoc(data) - Return the associative array

mysql_fetch_object(data) - Query, Return Object

mysql_num_rows(data) - Number of result rows

>> Connection status

mysql_ping(connection) - Check the connection, reconnect if disconnected

mysql_thread_id(connection) - Current connection ID

mysql_client_encoding(connection) - Current character set

mysql_list_dbs(connection) - List database

>> Last operation

mysql_info(connection) - Last queried information

mysql_affected_rows(connection) - Number of affected rows

mysql_insert_id(connection) ) - The last inserted ID

mysql_errno(connection) - The last error ID

mysql_error(connection) - The last error message

Input and output I/O


>> Print

print_r( value)

var_dump(value) - with type

var_export(value) - returns legal PHP code

Source

[PHP]PHP function

String STRING


> ;> Statistics

strlen(string) - Length

strcmp(string1,string2) - Compare strings

>> Find

strpos(string,find,start) - 在另一个字符串中查找, 返回第一次位置

    stripos(string,find,start) - (大小写不敏感)

    strrpos(string,find,start) - (最后一次)

    strripos(string,find,start) - (大小写不敏感)(最后一次)

strstr(string,search) - 在另一个字符串中匹配, 返回第一次匹配值及剩余部分

    stristr(string,search) - (大小写不敏感)

str_replace(find,replace,string,count) - 替换

    str_ireplace(find,replace,string,count) - (大小写不敏感)

substr(string,start,length) - 截取

>> 转换

explode(separator,string,limit) - 字符串 -> 数组

    implode(separator, array) - 数组 -> 字符串

    join(separator,array) - 同上

str_split(string,length) - 字符串分割为数组

parse_str(string,array) - 解析Query串为数组

strtolower(string) - 小写

    strtoupper(string) - 大写

str_shuffle(string) - 随机打散

strrev(string) - 反转

>> 输出

echo(string)

    print(string)

    printf(format,arg1,arg2,arg++) - 格式化输出

    fprintf(stream,format,arg1,arg2,arg++) - 格式化输出到文件

    sprintf(format,arg1,arg2,arg++) - 格式化到字符串

>> 格式化

str_pad(string,length,pad_string,pad_type) - 填充到指定长度

str_repeat(string,repeat) - 重复指定次数

chunk_split(string,length,end) - 插入分隔符

number_format(number,decimals,decimalpoint,separator) - 格式化数字

trim(string,charlist) - 两端清理

strip_tags(string,allow) - 剥离HTML, XML, PHP标签

>> 转义

addslashes(string) - 在预定义字符前添加反斜杠

    stripslashes(string)

    addcslashes(string,characters) - 在自定义字符前添加反斜杠

    stripcslashes(string)

htmlentities(string,quotestyle,character-set) - 全部字符 -> HTML实体

    html_entity_decode(string,quotestyle,character-set) - HTML实体 -> 字符

    htmlspecialchars(string,quotestyle,character-set) - 部分字符( & | " | ' | < | > ) -> HTML实体

    htmlspecialchars_decode(string,quotestyle) - HTML实体 -> 字符

nl2br(string) - /n ->

>> 加密

crypt(str,salt) - 单向有损加密

    md5(string,raw) - 散列

        md5_file(path,raw) - 文件有损摘要

    sha1(string,raw) - SHA1散列

        sha1_file(file,raw)

>> ASCII

ord(string) - 返回第一个字符的ASCII

数组 ARRAY


>> 新建&赋值

list(var1,var2,val3...) = $array - 用数组元素给变量赋值

range(min,max,step) - 建立指定范围的数组

array_combine(array1,array2) - 新建数组:array1为key,array2为value

>> 栈

array_pop(array) - 尾部出栈

array_push(array,value1,value2...) - 尾部入栈,相当于$array[] = $value

array_shift(array) - 首部出栈

array_unshift(array,value1,value2,value3...) - 首部入栈

>> 统计

array_sum(array) - 所有元素的和

array_product(array) - 所有元素的乘积

count(array,mode) - 统计元素个数,同 sizeof(array,mode)

array_count_values(array)  - 统计元素出现次数

array_keys(array,value,strict) - 返回对应的key

array_values(array) - 返回所有value

array_search(value,array,strict) - 搜索value,返回key

in_array(value,array,type) - 检查value是否存在

array_key_exists(key,array) - 检查key是否存在

>> 比较

array_diff(array1,array2,array3...) - 差集

    array_diff_assoc(array1,array2,array3...)

array_diff_key(array1,array2,array3...)

array_intersect(array1,array2,array3...) - Intersection

array_intersect_assoc(array1,array2,array3...)

array_intersect_key(array1,arra y2,array3. ..)

>>Sort

sort(array,sorttype) - sort by value in ascending order (rebuild index)

rsort(array, sorttype) - sort by value in descending order (rebuild index)

asort(array, sorttype) - Forward sorting by value (keep index) arsort(array, sorttype) - Sort reverse by value (keep index)

natsort(array) - Natural sorting

natcasesort(array) - Size-insensitive natural sorting

ksort(array,sorttype) - Forward sorting by key

krsort(array,sorttype) - Reverse sorting by key

array_multisort(array, sorting order, sorting type) - Sorting

shuffle(array) - Randomly sort Random array sorting

array_reverse(array,preserve) - Reverse the order

>> Modify

array_change_key_case(array,case) - Convert case

array_filter(array,function) - Filter with the given method

array_map(function,array1,array2,array3...) - apply method to each element

array_fill(start,number,value) - fill array with given value

array_pad(array,size,value) - put Fill the array to a fixed length

array_flip(array) - exchange key and value

array_unique(array) - remove duplicates

>> merge & split

array_chunk(array,size,preserve_key) - cut

array_rand( array,number) - Randomly return array elements (return key when number=1)

array_slice(array,offset,length,preserve) - Intercept

array_splice(array,offset,length,array) - Replace

array_merge(array1 , array2, array3...) - Merge

array_merge_recursive(array1, array2, array3...) - Recursive merge (when the keys are the same)

>> Pointer

each(array) - Return the current element, and Move the pointer

key(array) - current key

current(array) - current value, same as pos(array)

next(array) - next value

prev(array) - previous value

reset( array) - Move to the beginning

end(array) - Move to the end

Date & Time DATE & TIME


checkdate(month,day,year) - Check the validity of the date

date(format,timestamp) - Formatted output time

>> Information

getdate(timestamp) - Get date & time information array

microtime(get_as_float) - Get current time information array

>> Timestamp

time() - Current time timestamp

strtotime(time,now) - Convert string to timestamp

mktime(hour,minute,second,month,day,year,is_dst) - Get timestamp

Directory DIR


opendir(path,context) - open the directory, return the handle

readdir(handle) - return the file name

closedir(handle) - close the handle

rewinddir(handle) - reset the handle

dir(directory) - Open the directory and return the object. The object has 3 methods: read(), rewind(), close()

File FILE


clearstatcache() - Clear the file cache status

parse_ini_file( file, process_sections) - Parse the ini file and return an array

set_file_buffer(file,buffer) - Set the file output buffer

>> File operation

readfile(filename,include_path,context) - Read the file and output to the buffer

readlink(linkpath)

file(path,include_path,context) - read the file as an array

file_get_contents(path,include_path,context,start,max_length) - read the file into a string

file_put_contents(path,data,mode,context) - write to the file

fopen(filename, mode, include_path,context) - open the file

fgetc(file) - read characters

fgets(file,length) - read One line, or specify the length g FGETCSV (File, Length, SEPAROR, Enclosure) -Chn CSV format, read a line

FPUTS (File, String, LENGTH) -Writing files

FPUTCSV (FILE, FIELDS, Seperator, Encloss) - Write a file in CSV format

fread(file,length) - Read a file

fwrite(file,string,length) - Write a file

fflush(file) - Output the buffer content to a file

ftruncate( file,size) - intercept the file

flock(file,lock,block) - lock the file

ftell(file) - pointer position

fseek(file,offset,whence) - position the pointer

rewind(file) - rewind Set the pointer position

 feof(file) - whether the end of the file is reached

                                                                                                         fstat (()) (     )

>> File status

fstat(file) - file information

 lstat(file) - file/soft link information

fileatime(filename) - last access time

filectime(filename) - on The inode information modification time

filemtime(filename) - the last file content modification time

filegroup(filename) - file user group

fileowner(filename) - file user

fileperms(filename) - file permissions

fileinode( filename) - file inode

filesize(filename) - file size

filetype(filename) - file type

>> path

pathinfo(path,options) - path information

linkinfo(path) - hard link Information

basename(path,suffix) - Get the file name

dirname(path) - Get the directory path

realpath(path) - Get the absolute path

>> Size

disk_total_space(directory) - Get the total space size

disk_free_space(directory) - size of available space

>> Determine

file_exists(path) - whether the file or directory exists

is_dir(path) - directory

is_file(path) - file

is_link(path ) - connection

is_readable(path) - readable

is_writable(path) - writable

is_executable(path) - executable

>> system

mkdir(path,mode,recursive,context)

rmdir(dir,context)

link(target,link)

unlink(filename,context)

copy(source,destination)

rename(oldname,newname,context)

touch (filename, time, atime)

chgrp(filename,group)

chmod(filename,mode)chown(filename,owner)glob(pattern,flags)

>> ; HTTP POST

is_uploaded_file(filename) - Whether the file is uploaded via HTTP POST

move_uploaded_file(filename,newloc) - Move the uploaded file

Errors and exceptions ERROR & EXCEPTION

debug_backtrace() - Generate backtrace associative array

debug_print_backtrace() - Output

error_get_last() - Get the lowest level error


error_log(error, type, destination, headers) - Error log

error_reporting(report_level) - Set the error reporting level

>> Trigger error/throw exception

trigger_error(error_message,error_types) - trigger error

throw new Exception() - throw exception

>> Specify handler function

set_error_handler(error_function,error_types) - error handling function

set_exception_handler(exception_function) - Exception handling function

Filter FILTER

filter_has_var(type, variable) - Whether there is this variable

filter_input(input_type, variable, filter, options) - Filter external input

filter_input_array ( input_type, args)


filter_var(variable, filter, options) - Filter variable

filter_var_array(array, args)

>> Filter

SANITIZE(filter)

FILTER_SANITIZE_STRING - Remove or encode special characters

FILTER_SANITIZE_ENCODED - Similar to urlendode

FILTER_SANITIZE_SPECIAL_CHARS - Similar to urlendode

FILTER_SANITIZE_MAGIC_QUOTES - Similar to addslashes

FILTER_SANITIZE_URL

FILTER_SANITIZ E_EMAIL

FILTER_SANITIZE_NUMBER_INT

FILTER_SANITIZE_NUMBER_FLOAT

VALIDATE(verification)

FILTER_VALIDATE_BOOLEAN

FILTER_VALIDATE_INT

FILTER_VALIDATE_FLOAT

FILTER_VALIDATE_URL

FILTER_VALIDATE_EMAIL

FILTER_VALIDATE_IP

FILTER_VALIDATE_REGEXP

FILTER_CALLBACK - Call custom function

File transfer FTP

>> connection

ftp_connect(host,port,timeout) - Establish a connection

ftp_ssl_connect(host,port ,timeout) - SSL secure connection


ftp_login(ftp_connection,username,password) - Log in to FTP

ftp_raw(ftp_connection,command) - Send command

ftp_exec(ftp_connection,command) - Execute command (after logging in) ftp_pas v(ftp_connection,mode) - whether to be passive Mode

ftp_systype(ftp_connection) - Remote machine system

ftp_get_option(ftp_connection,option) - Get parameters

ftp_set_option(ftp_connection,option,value) - Set options

    ftp_close(ftp_connection) - 关闭连接,同 ftp_quit()

>> 目录

ftp_mkdir(ftp_connection,dir) - 建立目录

ftp_rmdir(ftp_connection,dir) - 删除目录

ftp_chdir(ftp_connection,dir) - 改变目录

ftp_cdup(ftp_connection) - 父目录

ftp_pwd(ftp_connection) - 当前路径
ftp_nlist(ftp_connection,dir) - 列目录

ftp_rawlist(ftp_connection,dir,recursive) - Directory list details

>> Files

ftp_put(ftp_connection,remote,local,mode,resume) - Upload files

ftp_fput(ftp_connection,remote,local,mode,resume ) - Upload locally opened files

ftp_nb_put(ftp_connection,remote,local,mode,resume) - Asynchronous upload

ftp_nb_fput(ftp_connection,remote,local,mode,resume) - Asynchronously upload locally opened files

ftp_get(ftp_connection, local,remote,mode,resume) - Download file

ftp_fget(ftp_connection,local,remote,mode,resume) - Download and open file locally

ftp_nb_get(ftp_connection,local,remote,mode,resume) - Asynchronous download

ftp_nb_fget(ftp_connection,local,remote,mode,resume) - Asynchronously download to local open file

ftp_delete(ftp_connection,path) - Delete file

ftp_rename(ftp_connection,from,to) - Rename

ftp_chmod(ftp_connection, mode,file) - change file permissions

ftp_size(ftp_connection,remote_file) - file size

ftp_mdtm(ftp_connection,file) - file last modified time

HTTP


header(string,replace,http_response_code) - send HTTP headers

headers_list() - Headers list array

headers_sent() - Whether headers have been sent

setcookie(name,value,expire,path,domain,secure) - Set Cookie

Math MATH


>> Arithmetic

round() - Rounding

ceil() - Rounding up

floor() - Rounding down

max() - Return the maximum value

min () - Returns the minimum value

pow(x,y) - x raised to the yth power

sqrt() - Square root

abs() - Absolute value

rand(min,max) - Returns a random integer

>> Base

base_convert(number,frombase,tobase) - Any base conversion

decbin() - Decimal -> Binary

Bindec(binary_string) - Binary -> Decimal

dechex( ) - decimal-> hexadecimal

hexdec() - hexadecimal-> decimal

decoct() - decimal-> octal

octdec() - octal-> decimal

> ;> Trigonometric functions

cos() - cosine

acos() - inverse cosine

sin() - sine

asin() - inverse sine

tan() - tangent

atan() - - anyway Cut

MySQL


>> connection

mysql_connect(server,user,pwd,newlink,clientflag) - connection

mysql_pconnect(server,user,pwd,clientflag) - long connection

Mysql_close(connection ) - Close

>> Query

mysql_select_db(database, connection) - Select the database

mysql_query(sql) - Execute the query and return the resource handle

mysql_fetch_array(data, array_type) - Query, return the array

mysql_fetch_assoc (data) - Returns associative array

mysql_fetch_object(data) - Query, returns object

mysql_num_rows(data) - Number of result rows

>> Connection status

mysql_ping(connection) - Check connection, reset if disconnected Connect

mysql_thread_id(connection) - Current connection ID

mysql_client_encoding(connection) - Current character set

mysql_list_dbs(connection) - List database

>> Last operation

mysql_info(connection) - Last query Information

mysql_affected_rows(connection) - number of affected rows

mysql_insert_id(connection) - last inserted ID

mysql_errno(connection) - last error ID

mysql_error(connection) - last error message

input and output I/O


>> Print

print_r(value)

var_dump(value) - with type

var_export(value) - return legal PHP code

The above introduces [PHP]PHP functions, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template