Note: Unless the array is referenced, foreach operates on a copy of the specified array, not the array itself. So the array pointers are not changed by the each () structure, and the changes to the returned array cells do not affect the original
A classmate asked a question:
Copy the Code code as follows:
for ($i = ' A '; $i echo $i;}
What is the output?
The output is:
Abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalamanaoapaqaras .....
Why?
In fact, it is very simple, the PHP manual
The first method: If you do not affect the normal execution of the program, you can use the method of shielding
The first line of the code can be added
Error_reporting (e_all ^ e_notice);
Turn off warnings for notice errors
The second method:
Copy the Code code as follows:
/*—————————————————— */– Get list data for an unlimited assortment/*—————————————————— */function Get_sort ($parent _id=0, $n =-1){Global $db;static $sort _list = Array ();$sql = "SELECT * from". $db->table ('
The principle of the function is very simple, the main is to use a recursive call.
Copy the Code code as follows:
function File_list ($path) {if ($handle = Opendir ($path)) {while (false!== ($file = Readdir ($handle))) {if ($file! = "." && $file!
Recently in a topic polling site, customers know something about the program. There are special requirements to filter some characters to prevent SQL injection. There was no particular study on this front. Oh, and carry forward a back take doctrine.
Later on the fire, in the virtual machine installed WIN2003 a test, loading MSSQL module is no problem, but with mssql_connect ("localhost", "sa", ""), but how also not connected to the database, and later on the Internet to check a lot of
Copy CodeThe code is as follows:
$rptype = 0 means only HTML tags are replaced$rptype = 1 to replace HTML tags while removing contiguous whitespace characters$rptype = 2 to replace HTML tags while removing all whitespace characters$rptype = 1 means
Copy CodeThe code is as follows:
$arr =array ();$arr [' Good ']= ' bad ';$arr [' bad ']= ' not bad ';$arr [' Bad ']= ' good ';$arr [' Not bad ']= ' bad ';$str = "We are not good";Echo Strtr ($str, $arr);Output we are bad not bad?>
So the
I divide the graphics editing program into two categories: a (yes) drawing program, which allows you to draw images one pixel at a pixel (ground), and another (yes) charting program that provides a set of objects, such as lines, ellipses, and
Let me tell you about the loading process for this system.
Define the root directory, define the Include directory
Loading core Files
Config file ' config.inc.php '
global function ' global.func.php '
Directory operation function ' dir.func.php
I have been very confused. In the document, said the more obscure, is move_uploaded_file this function, added a step check, check whether the file is HTTP POST upload,
As for, how to check the not said.
I google for a while, have not been able to
/**
* Fills a string into a string of a specified length (Multi-byte security)
* @param string $str to specify the character to be populated
* @param int $len Specifies the length of the filled string, if the value is negative or less than the
It is determined by the session ID, what is the session ID, is the file name of the session file, session ID is randomly generated, so to ensure uniqueness and randomness, to ensure that the session security. In general, if the lifetime of the
1. Catalogue Inc has the following contents:
Sub-Catalog 0
Sub-Directory A
Footer.html
Header.html
login_function.inc.php
mysqli_connect.php
Style.css
2, now PHP to traverse the INC directory, and only display files, do not display directories 0 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