PHP images are more detailed and annotated than scaling and adding logo watermark codes
PHP picture of the equal than scaling and increase the logo watermark/** * than the scaling function (implemented in a saved way) * @param string $picName
In-depth study of PHP encryption and decryption of Ucenter API
The cryptographic decryption function in the Ucenter API, known as the classic PHP domain, is also a major contribution of the Hong Sing company to PHP.
This function can be used to
All file encodings under PHP conversion folder
The encoding of all files under the PHP conversion folder is suitable for other encoded versions of the publishing site for example, you have a GBK version you want to have a UTF8 version or you only
Get_headers () is a PHP system-level function that returns an array containing the headers sent by the server in response to an HTTP request. If it fails, it returns false and emits an e_warning level error message (which can be used to determine if
Several methods of PHP passing values in CLI mode
PHP itself is a scripting language that can be used efficiently in command-line environments, but how does the CLI (command line Interface) pass in a value?
Here are the 3 ways I know.
A. getopt
Nginx upload parameter problem, need to pay special attention to client_max_body_size this parameter, otherwise it will interrupt the request in Nginx.
General PHP configuration for file upload parameters php.ini file is as follows:
File_uploads
Using the Curl method to simulate Telnet * Analog login bbs.php100.com
$cookie _file= Tempnam ('./temp ', ' Cookie '); $login _url= ' http://bbs.php100.com/login.php '; $post _fields= ' cktime= 31536000&step=2&pwuser= Enter your username here
PHP program development can use predefined constants & variables to obtain information in PHP, commonly used predefined constants as shown in the following table.
Constant name
Function
_file_
Default constants, PHP
PHP Program performance profiling (using Xdebug and Webgrind)
Before the PHP program goes online, we usually need to do a profiling to see where the program spends its time. One of the simplest methods is to use the XDebug profile feature. XDebug
Snoopy PHP Collection Class usage instructions detailed
Snoopy is a PHP class that simulates the functionality of a browser to get web content and submit a form.
Snoopy the PHP version that requires your server to run correctly is above 4 and
Get timestamp for the first day of the Week/last day
$year = Date ("Y"); $month = Date ("M"); $day = Date (' W '); $nowMonthDay = Date ("T"); $firstday = Date (' d ')-$day; if (substr ($firstday, 0,1) = = "-") { $firstMonth = $month-1;
In PHP, the quickest way to read a file is to use functions such as file, file_get_contents, and just a few lines of code to do what we need.
But when the file being manipulated is a larger file, these functions may be out of the way, the following
PHP infinite Pole classification is often used, a simple PHP infinite pole classification code is as follows:
Data table structure
CREATE TABLE IF not EXISTS ' category ' ( ' id ' int (5) is not NULL auto_increment COMMENT ' unique self-increment
PHP extracts the birthday date from the ID number and determines whether a function is adult. Both 15-and 18-bit IDs can be identified at the same time.
Share the function code as follows:
Date ("Y") | | $tyear 12) {$flag = 0;} ElseIf ($tday 31) {
Unable to upload file, all returned failed. After the discovery is PHP is_uploaded_file function in mischief, the following is the specific treatment method, a similar situation of friends can refer to the following
Cause:
In one project, the user
Define and use the Array_walk () function to apply a callback function to each element in the array.
Returns TRUE if successful, otherwise FALSE. Typically, a function accepts two parameters. The value of the array parameter as the first, the key
There are a lot of complaints about PHP, and even these complaints come from a lot of smart people. When Jeff Atwood wrote another complaining article about PHP, I thought about the good aspects of PHP.
The biggest problem with these complaints is
PHP cache array of variables, in effect, is to write the array of PHP to a text file or a suffix called. php is stored, directly call this file when used.
So how do you use PHP to save an array as a text-formatted file?
Three ways to write a PHP
Learn PHP Well, you should know this
First of all you should be in PHP 5.3 and above, if the PHP version under this, it is time to upgrade. I recommend that you use the latest version if you have a condition.
You should have seen PHP the right, and
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