Configuration:
1. Download VC9 x86 thread safe to Windows.php.net/download website
2. Extract files to directory.
3. Change php.ini (Will php.ini_d .....) Delete the following) and open the MySQL extension (that is, delete;
This example describes how PHP uses cookies to control access authorization. Share to everyone for your reference. Specifically as follows:
Copy Code code as follows:
if (isset ($_post[' name ')) | | Isset ($_post[' pass ')) {
If there
PHP in English mixed character truncation not garbled function (UTF8)
Copy Code code as follows:
Chinese character truncation in UTF8 format
$sourcestr is the string to process
$cutlength the length of the interception (ie the number
Spam is annoying, here is a way to automatically screen robots from your site to collect e-mail addresses.
Copy Code code as follows:
function Security_remove_emails ($content) {
$pattern = '/([a-za-z0-9._%+-]+@[a-za-z0-9.-]+\.[ a-za-z]{2,
Today in the transfer of a mall page information, using file_get_contents or curl:
Copy Code code as follows:
$url = ' http://www.xxx.com/21/?type=23′;
$temp = file_get_contents ($url);
Echo $temp;
Get a piece of
Iconv is a conversion code, but there is an incomplete display problem when the Chinese transcoding.
Copy Code code as follows:
Iconv ("UTF-8", "Gb2312//ignore", $data); Add//ignore, ignore error
or use Mb_convert_encoding ()
Many times, when writing a Web application, you will encounter Chinese and other character conflicts, such as some URL link contains the characters, then in the use of wget/curl/file_get_contents and so on to get information will directly hit a big "
Copy Code code as follows:
$a = Array (1, 2);
$b = Array (11, 12);
foreach ($a as & $r) {
}
foreach ($b as $r) {
}
echo $a [1]; Output 12
The two cycle is meant to be: the first loop needs to modify the contents of the
Very basic things, feel the code is not concise enough, I hope the Master Guide to modify
Copy Code code as follows:
function Bubblesort ($STR) {
for ($i =0; $i For ($k =count ($STR)-2; $k >= $i; $k-) {//To bubble this value
So below share a PHP write to get each search Spider crawl record code
Support Search engine as follows
Can record the Baidu,google,bing,yahoo,soso,sogou,yodao crawl website record!
The PHP code is as follows
Copy Code code as follows:
1. Universal Caching Technology:
Data caching: Here is the data cache refers to the database query PHP caching mechanism, each visit to the page, will first detect the corresponding cache data exists, if it does not exist, connect the database,
This paper summarizes the method of adding elements of PHP array in detail. Share to everyone for your reference. The specific analysis is as follows:
If we are a one-dimensional array that adds an array element we can use Arraylistay_push, of
This article describes the PHP to determine the type of file upload and filtering of unsafe data methods. Share to everyone for your reference. Specifically as follows:
It is not safe to upload files other than picture files, prompt, do not get
include performance
Copy Code code as follows:
Include (' include.php ');
Of course there is no mistake in this way, but in terms of efficiency it is slightly worse than the following:
Copy Code code as follows:
This article illustrates the method of generating pie chart in PHP drawing. Share to everyone for your reference. Specifically as follows:
The function to be achieved here is the population distribution scale graph, which consists of a sector of a
This article gives an example of how a PHP drawing loads an external picture. Share to everyone for your reference. The implementation methods are as follows:
In the practical application, is the common watermark function.
Copy Code code as
The example in this article tells you how to draw a straight line in PHP. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
1. Create Canvas
$im = Imagecreatetruecolor
This example describes the creation and deletion of PHP folders. Share to everyone for your reference. Specifically as follows:
1. Create a folder
Copy Code code as follows:
Creating a Folder
$file _path = "d:/fold/";
if
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