[Web technology learning] PHP Study Notes

Source: Internet
Author: User

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

<> Note: // and # are both single-line annotations.
Variable:
PHP is case sensitive.
Use $ to define variables, and use the reference definition &
Use define to define constants.
Scope:
Define global variables -- global $ variable;
PHP places all the variables in the global [""] array. You can use global ["variable"] to access variables outside the scope.
Static variable -- keep its value.
Variable output:
<? = $ Name?>
Each
Print ($ SS)
Form variables
PHP automatically receives and saves it in environment variables.
$ _ Post [""] variables and $ _ Get [""] process form variables, corresponding to the POST method and method.
Environment Variables and system Constants
Some network request protocols and system configuration information.
Dynamic tables on a web page are generally implemented using auto-increment counting and remainder line feed.
String:. indicates a string connection. It is similar to "+" in Java and "/" is an escape character.
PHP Data Type: it is automatically assigned during definition. Pay attention to it during calculation or conversion. Objects and arrays are available.
File Inclusion:
Require, require_once -- errors are generated and code execution is aborted.
Include, include_once -- generates a warning, and the code will not be aborted.
Function:
Fucntion function name (parameter 1, parameter 2 ,......)
{
Function body code;
Return return value;
}
Array:
Definition:
$ Array_varible = array ();
$ S = array (11,12, 13 );
The key name can be specified, similar to the hash table:
$ S ['Tom '] = 11;
You can also write it as follows:
$ S = array ("Tom => 11 ");
Print: print_r (array_variable );
Traversal: foreach statement
A two-dimensional array consists of multiple one-dimensional arrays.
String:
Print sprintf

Author: gnuhpc
Source: http://www.cnblogs.com/gnuhpc/

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.