php-type function

Source: Internet
Author: User

/* "type operation function" * /

get / set type

GetType ($var)// get the data type of the variable

Settype ($var, $type)// set the data type of the variable

Type judgment

Is_int

Is_float

Is_null

Is_string

Is_resource

Is_array

Is_bool

Is_object

Is_numeric Detect if a variable is a numeric or numeric string

convert to the specified data type

Boolval

Floatval

Intval

Strval

Cast Type

(int)

(float)

(string)

(BOOL)

(array)

(object)

(unset)// convert to NULL

(binary) Conversion and B- prefix conversion // conversion to Binary

Var_dump information about the print variable.

Displays structure information about one or more expressions, including the type and value of the expression.

The array recursively expands the value and displays its structure by indentation.

Var_export ($var [, BOOL $return])// output or return a string representation of a variable

$return: true toreturn the result of the variable after execution

Print_r to print easy-to-understand information about variables

Empty checks if a variable is null

Isset Detecting whether a variable exists

/* "Process Control" * /

alternative syntax for an IF statement

if ( condition judgment ):

statement block ;

ElseIf ( conditional judgment ):

statement block ;

else:

statement block ;

endif

alternative syntax for Process Control

often used in embedding HTML

Replace { with:, change } to endif; wait

endif

Endwhile

ENDfor

Endforeach

Endswitch

php-type function

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.