Many people think that htmlentities and htmlspecialchars have the same functions and are used to format html code. I used to think so, but today I found this is not the case. The translations saved Med are:
The code is as follows:
'&' (Ampersand)
This program can generate PNG images of the current time without using the GD Library, which is of great reference value. teaman: This program does not use the GD library to generate PNG images of the current time. it is very helpful for you. teaman
Curl_close, set of CURL function libraries in PHP-close a curl session
Curl_copy_handle-copy all content and parameters of a curl connection resource
Curl_errno-a number containing the current session error message is returned.
Curl_error-returns a
Replace the phpsession class with the mysql memory table. you can test the effect on your own.
The code is as follows:
/**@ Usage: use some other storage method (mysql or memcache) instead of php sessoin@ Author: lein@ Version:
Recently, I have seen a website infected with Trojans and sent a php character filtering class. I suggest you pay more attention to the security knowledge of webmasters. The code is as follows:
The code is as follows:
Abstract class Filter {//
Some common definitions of static constants in php.
1. define the CONSTANT define ("CONSTANT", "Hello world .");
Constants can only contain scalar data (boolean, integer, float, and string ).
When calling a CONSTANT, you only need to obtain the
The following describes how to use the header function. The following describes how to use the header function.
No matter how many headers there are on the page, it executes the last one, but it is conditional. for example:Header ('Location: https:/
Php date and time processing function summary, hour, date, and so on. It is worth your reference. Merge php computing hours to zero
The code is as follows:
/* Author: Yang yuyangyu@sina.cn */// The $ hours_min parameter is an array. the array
Most php users use cookies once they apply them to the session. Although cookies are good, they also bring us some hidden risks. Risk 1: if the cookie on the client machine fails due to a virus, the session will be lost.
Hazard 2: Sessions are
Php is popular recently, so more and more friends are learning php. here we will sort out some database operations. For more information, see.
1. create a database table:
The code is as follows:
Create database club;Create table member (Id int (11
At the beginning, I was wondering why there were two libraries, and there were official documentation support in php.net. I tried to use memcache before. later I found that memcached supports the setMulti method and is ready to switch to the
Today, I am building a blog installer. The first step is to create a configuration file. First Look
File interface before creation
After the configuration file is created, the system prompts that the installation cannot be repeated.
Let's go to
Mayfish can flexibly customize validation rules for the data content to be written to reduce the trouble for developers to manually verify the data of each field. Before writing data to the database, you should first verify the data to be written to
This function converts the URL and e-mail address strings into clickable superlinks.
The code is as follows:
Function makeClickableLinks ($ text ){$ Text = eregi_replace ('(f | ht) {1} tp: //) [-a-zA-Z0-9 @: % _ + .~ #? & // =] +) ',' \ 1', $
I realized it only today when I read the joomla source code. In the past, this operator can also be used as a non-static method of the category class. It really surprised me. It has always been assumed that the scope parsing operator can only be the
Wei shield PHP encryption expert decryption algorithm By: Neeao, encountered using Wei shield PHP encryption expert encryption code, you can use the following code to view the source file.
The code is as follows:
/*******************************
We often process data from user input or read from the database. There may be extra spaces or tabs in your string, and press enter. Storing these extra characters is a waste of space. You can use the PHP internal function trim () to remove the
In the last PHP Unit test tool: PHPUNIT, we have a preliminary understanding of phpunit. in this article, we will continue to explain in depth some usage of phpunit.
1. markTestSkipped and markTestIncomplete
In phpunit, there are two useful
In PHP, use list to extract the values in the array, such as list ($ a, $ B) $ array.
1. value extractionIn PHP, use list to extract the values in the array, such as list ($ a, $ B) = $ array. If the number of values in the list is greater than the
In PHP programming, the generation of random numbers is particularly important. We need to use a random number to display random records (such as video, user records, and article IDs) on our page ). We can also use random numbers to design any
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