P The next day PHP and mysqlweb Development

Source: Internet
Author: User

Chapter 1

Some arrays are called Super global variables,

$ _ Globals all global variable Arrays

$ _ Server environment variable

$ _ Get, $ _ post are passed to the variable array of the script in two ways.

$ _ Cookie, $ _ Session Cookie variable array, and session variable array

$ _ FILES variable array related to File Upload

$ _ ENV Environment variable array

$ _ Number of requests for all users, including $ _ Get, $ _ post, and $ _ cookies (excluding $ _ files)

Define Constants

Define ('constant name', constant value );

Operator

Variable names or any other text in single quotes will be sent to the browser without any modification.

Variable names in double quotation marks are replaced by variable values.

Heredoc... what shit ....

Error suppression operator @...

Execute the operator and execute the server-side command ~ Same Key Position

Array operator + union, $ A + $ B returns an array of all elements of $ A and $ B

Test and set the variable type

GetType (variable), setype (variable, type), what else is is_array (), is_int (),.... is_object (): whether is_null () is null, is_resource () is a resource, is_numeric () is a number or number character of any type, and is_callable () is a valid function name.

Test variablesStatus

Isset (variable) whether the variable exists, unset (variable) destroys a variable, empty (variable) whether the variable exists, and whether the value is null

Re-interpretation of variables (changing the type of variables)

Intval (), floatval (), strval ()

$ Aname; the Code is the code that I used to look for. Haha. dynamically create variable names...

The difference between exit and return.

 

Chapter 2

Write data to a file and read data from the file.

ResourceFopen(
String filename, string mode [, bool use_include_path [, Resource
Zcontext])

   
1. File Path (only file names can be written)
   
2. Mode: R, W, A, x (careful writing mode. If the file exists, false is returned and PHP errors are generated) and R +, W +, x +, A +

   
We strongly recommend that you add B to open the file in binary mode to avoid many problems.

   
With the plus sign, the read/write mode is used, R is read-only, W and a are write-only, W points to the beginning of the file (overwrite) A points to the end of the file (Continued write)

   
3. use_include_path if you want to find a file in include_path, you can set 1 (true)

   
4. protocol, such as HTTP... you know, remote... (related PHP. ini configuration)

$ _ Server ['document _ root']; obtains the root of the web server's document tree.

The file path uses a forward slash to maintain versatility ....

IntFwrite(
Resource handle, string [, int length]
)Alias fputs ()....

   
1. Obtained file resources

   
2. content to be written

   
3. Write length (avoid platform problems when using binary)

IntFile_put_contents(String filename, string data
[, Int flags [, resource context])

Function used to Read File Content

StringFgets(
Int handle [, int length])

StringFgetss(
Resource handle [, int length [, string allowable_tags]
)

ArrayFgetcsv(
Int handle [, int length [, string delimiter [, string enclosure]
)
Four functions for reading all the File Content

 1. intReadfile(
String filename [, bool use_include_path [, resource context]
)

 2. intFpassthru(
Resource handle)

 3. ArrayFile(
String filename [, int use_include_path [, resource context])

 4. StringFile_get_contents(String filename [, bool
Use_include_path [, resource context [, int offset [, int
Maxlen])

Read one character

StringFgetc(Resource handle)

Read arbitrary length

StringFread(INT handle, int Length
)

Functions of other operation files

BoolFile_exists(String filename
)  Whether the file exists

IntFilesize(String filename
)       File Size

Nl2br (); replace \ n with <br/>

BoolUnlink(String filename
)          Delete an object

File Location

BoolRewind(Resource handle)

IntFseek(Resource handle, int
Offset [, int whence])

IntFtell(Resource handle)

File lock
Flock () Synchronization ............. directly use dB to store data .... solve this problem ..... what .... i'm so arrogant .....

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.