PHP learning Notes 01

Source: Internet
Author: User
Tags constant definition
PHP learning notes 01PHP integrated installation environment AppServ, built-in apache, mysql, php script parsing tools. Development Tool: ZendStudio. : Www.zendstudio.net. Set workspace to the phpwww directory for debugging. Set the Zend template. Set the code prompt. & Lt ;? Php % & gt; write php code. Single PHP Study Notes 01
AppServ is an Integrated PHP installation environment with built-in apache, mysql, and php script parsing tools.
Development Tool: Zend Studio. : Http://www.zendstudio.net /.
Set the workspace to the php www directory for debugging.

Set the Zend template.
Set the code prompt.


%>
Write php code.


// Single line comment
/**/Multi-line comment

Browser output first
Echo ""; the running speed is slightly faster. echo single quotes are entered directly without conversion.
Print ""; returns an integer.

The variable starts with $ and does not need to be defined.

Data type conversion
Add a type before the variable, which can be forcibly converted, such as (float) $ num

Gettype () get the variable type
Settype () can also be used for type conversion.

Isset () determines whether a variable exists
Unset () destroy variable

Empty () determines whether the variable value is null. it can be string, integer, or array.

Type judgment function:
Is_integer
Is_int
Is_array
Is_null
.....

Data type conversion functions:
Intval ();
Floatval ();
Strval ();

Assign the converted data to the new variable, and settype convert the original variable.

Define () constant definition. the constant name is generally an uppercase letter. Constants cannot be modified.

Access Form variables:

$ _ POST ["name"]
$ _ GET ["name"]

String concatenation '.'



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.