In PHP, a foreach statement is used to iterate through an array, and each time a loop is made, the value of the current array element is assigned to the value variable (the array pointer moves down one by another)
Cases
The code is as
Infinite classification is a problem that will be encountered in all program development, let me introduce the php+mysql implementation of an infinite class of classification procedures, the need for friends can refer to.
Here's a look at my
There may be many friends in the local use of phpMyAdmin when the next will find and need to re-login, this is very inconvenient I will introduce the modified phpMyAdmin default login timeout method.
phpMyAdmin default time-out is 1800 seconds, too
PHP page Chinese garbled appearance There are several reasons, one is the page encoding does not count one, the second is the database is not set code, the third is the problem of the Apache code, the following I will give you two solutions, in
This is a PHP and MySQL based on the site traffic statistics instances, can be counted out to visit the source of the site personnel, search engines, IP, keywords, I hope this example for you to help.
Traffic statistics tools, such as CNZZ, Baidu
This file download instance is very detailed he is combining the header function with the while Fread function to read out the file and then send to the client, a standard file download instance.
A small instance of a php file download/*=============
MySQL server MySQL and INFORMATION_SCHEMA database is the system database, this is very little useful for us, but we can not remove them they are key, then how to hide MySQL and information_ Schema database, let's look at ways to hide them.
This
PHP recursive function when using return will not be able to correctly return to the desired situation, if you do not understand the reasons, it is difficult to find the wrong, the following specific examples to illustrate:
Copy CodeThe code is as
We want to generate two-dimensional code will need to use some class library to achieve, the following I introduce the use of PHP QR code to generate two-dimensional code bar, the generation method is very simple, let me introduce.
PHP Class library
Main interface:
Can obtain the merchant product, obtains the news information and so on. If you are interested, you can look at this platform.
Scan the QR code, or add friends, find the public number, and search for "Gardening Street"
In writing the registration system, if you want to check whether the user name exists, PHP can write:
Copy CodeThe code is as follows:
$username =$_request[' username '];
$password =$_request[' password '];
echo "
Excute the Insertuserinfo ";
$con =
PHP uses the Super global variable array $_files to record the file upload information, before uploading the PHP file, you can adjust the
1.file_uploads=on/off
Whether to allow uploading of files via HTTP
2.max_execution_time=30
Allow the maximum
This article for you to introduce the use of the header to export Excel, specific implementation code as follows, interested friends do not miss
The code is as follows:
where ($where)->order ($order)->select (); if (Is_array ($lists) && count
In PHP to use the regular to match Chinese characters, we need to understand the string encoding and then also have the inner code of the Chinese characters so as to facilitate the rapid implementation of the precise matching of Chinese characters
There are many ways to write an array to a file in PHP, like when we want to make a cache file, we convert the PHP array into a file and then save it to a. php file, which is called directly when called.
PHP writes an array to a file, which is
There are many ways to convert HTML tags into plain text in PHP, like PHP comes with a function strip_tags it can convert HTML directly into plain text format, let me take a look at the various conversion code.
First look at the Strip_tags ()
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