PHP built-in variable: directory_separator
Directory_separator is a PHP built-in command that returns the path separator associated with the operating system, returned on Windows, and returns on Linux or Unix-like, that's the difference. It is
Background
Their server is a cloud server, the recent frequent php-fpm suspended animation state, hard disk and memory are relatively small, so the memory is often not enough, through the Linux command to view, found that the number of boot PHP-FPM
It is quicker to use single quotes instead of double quotes to contain strings. Because PHP searches for variables in a string enclosed in double quotes, single quotes are not, note: only echo can do this, it is a "function" that can take multiple
The first is the Apache installation
Yum Install httpd
After the installation is complete, allow Apache to boot
Systemctl Enable Httpd.service
Then start the Apache service
Systemctl Start Httpd.service
Generally speaking, the system is open
Scope of a variable
Also known as the scope of a variable, the scope of a variable is the context in which it is defined (also its effective range),
Most PHP variables have only a single range, and this single range span also contains files
To read and write files in PHP, you can use the built-in functions:
1.fopen (create file and open file)
Grammar:
Copy code code as follows: fopen (Filename,mode)
filename, specify the file to open. mode, open the pattern of the file, the possible
PHP Tags
When parsing a file, PHP looks for the start and end tags, which is
PHP also allows the use of short tags. And, but not encouraged to use. Short tags can only be used if you activate the Short_open_tag configuration directive in php.ini
PHP image processing get picture resources
Resource Imagecreatefromxxxx (String $filename)Returns an image identifier that represents an image obtained from a given file name. get picture Related information
GetImageSize ()
The function will
Reprint Address: http://blog.csdn.net/hshxf/article/details/5666145
1, Prepare thrift PHP Client base class, this can be obtained from the thrift source package, under THRIFTSRC/LIB/PHP/SRC, generally have the following directories and files:
PHP Common function Summary mathematical function 1. ABS (): the absolute value $abs = ABS (-4.2); 4.2 Numeric value Absolute number 2. Ceil (): Take the whole echo ceil (9.999) in one method; 10 floating-point number into a whole 3. Floor (): To
The second parameter of the PHP date () function is of type int, and if it is a string type, the result becomes 1970-01-01 xx:xx:xx, so how do you turn the two types of time to each other? Check the PHP API, there is a function, it is strtotime () ..
One, the error of the procedure itself
This error is a relatively easy to handle errors, such as syntax errors or the compiler can not resolve, these errors at compile time, will not compile, and then according to the wrong hint, to find the
upload the xlsx file to the workspace and store the data in the database MySQL
Controller Layer
upload.php
Class Upload extends Ci_controller {Public Function __construct (){Parent::__construct ();$this->load->helper (Array (' form ', ' url
PHP uses Curl request data is very common, but according to the http/1.1 protocol in the post submission data encoding method, the use of Curl function parameters of the choice is also different.The Content-type in the header headers of the request
A The first is the coding of PHP pages
1. php file itself and the encoding of the Web page should match
A. If you want to use gb2312 encoding, then PHP to output headers: header ("content-type:text/html; charset=gb2312 "), static page add B. If you
Writing good code is an art. If a programmer follows some good programming habits, then he can become a good programmer. In fact, you'll probably spend more time on code maintenance than when you write code, not to mention the entire application
$data = file_get_contents ("Php://input");
Php://input is a read-only stream that can access the requested raw data. In the case of POST requests, it is best to use php://input instead of $HTTP _raw_post_data because it does not depend on specific
This article introduces, in the Nginx PHP-FPM uses the sock way to configure the example, has the need friend, the reference under.
Sock configuration of Nginx php-fpm, as follows:Copying code code example: location ~ \.php$ {Fastcgi_pass
Serialize () and unserialize() are explained in the PHP manual:
Serialize -generates a storable representation of a value
Serialize -represents a value that can be stored
unserialize -creates A PHP value from a stored
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