1. How to create a PHP installation program
In fact, the installation principle of the PHP program is nothing more than to import the database structure and content into the corresponding database, from the process to reconfigure the database
Our grassroots webmaster purchase of the virtual host often have a limited number of files, a large number of small files occupy a large number of resources, the outdated essence of the brother recommended watercress solution, but to have host
Using single quotes instead of double quotation marks to contain strings can be faster. Because PHP will search for variables in a string surrounded by double quotes, single quotes will not, note: only echo can do this, it is a string can be used as
Copy CodeThe code is as follows:
/*
A function that determines whether a string exists
*/
function strexists ($haystack, $needle) {
Return! (Strpos ($haystack, $needle) = = = FALSE);//Note the "= = =" Here
}
/*
Test
*/
$mystring = ' abc ';
$findme =
Park,unpark,ord These 3 functions, in our work, they are estimated to be few. I am in a recent job, because the communication needs to use the binary stream, and then the interface is received in PHP. At that time, a lot of information was consulted.
A string is series of characters.
String access and modification by character
Characters within strings May is accessed and modified by specifying the zero-based offset of the desired character after The string using square array brackets, as in
The goal of the rule is to change the reporting part of php.ini, so that notice does not show
error_reporting = E_all; Display all errors, warnings and notices
Change into
error_reporting = e_error & ~e_notice & ~e_warning
Or
Isset ($_get["page"])
is to "split" the number in the original array into a "single" bit.
Here is a function that I wrote:
Copy CodeThe code is as follows:
function Splitstrtoarray_mine ($array)
{
$new _array = Array ();
foreach ($array as $value)
{
$value = (string)
Copy CodeThe code is as follows:
/*—————————————————— */
– Recursive deletion of files and directories
– Example: Del_dir ('.. /cache/'); Note: returned/is required
– $type Force Delete directory, true Yes, false no
/*—————————————————— */
function
But in the last few days it's been a bad day, with 90% of attacks that can't be intercepted, take a look at the stats:
IP attack and start time
Number of attacks
Place
Note
125.165.1.42
first, what is an array
An array is a set of data that organizes a series of data to form an operational whole. Each entity of an array contains two items: A key and a value.
ii. Statement of data
There are two main ways to declare an array in PHP:
1. Use of arrays in PHP
Using associative arrays (associatively-indexed arrays) is helpful when manipulating databases, so let's look at an array traversal of a basic number format:
Copy CodeThe code is as follows:
$temp [0] = "Richmond";
$temp [1
Looking for a long time, found on-line information is very few, so want to write their own, and slowly found that more problems, their own not much of the algorithm, write a calculation of the short point is OK, long hung, and then long I am afraid
The principle of the function is very simple, the main is to use a recursive call.
Copy CodeThe code is as follows:
function File_list ($path) {
if ($handle = Opendir ($path)) {
while (false!== ($file = Readdir ($handle))) {
if ($file! = "." &&
The company has several web sites on the United States virtual host, the server's MySQL service almost every day will suddenly not know when to hang up, and then resumed after a while, suspicion is exceeded the CPU usage limit and is automatically
Mysql.class.php file See http://www.jb51.net/article/25496.htm
Copy CodeThe code is as follows:
Includes MySQL operation class
Include_once ' Mysql.class.php ';
Local MySQL Data
$mysql _local_data = Array (' db_host ' = ' localhost ',
' Db_user '
The process of configuring PHP and MySQL is omitted, if under Ubuntu, refer to Ubuntu 10.04 installation Memo.
1. Basic syntax
The way to embed PHP scripts in HTML code is to
Write code in. Output data to the browser using the Echo or print
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