When the number of arguments
When the number of formal parameters, PHP will not error, it will only take the previous several parameters, the excess will be discarded.
When you write a function in PHP, the function is normally called, and the
Today, I developed the following code, is the first, a day to intercept 15 IP, the server load is normal.
Copy CodeThe code is as follows:
Query prohibit IP
$ip =$_server[' remote_addr '];
$fileht = ". Htaccess2";
if (!file_exists ($fileht))
A classmate asked a question:
Copy CodeThe code is as follows:
for ($i = ' A '; $i echo $i;
}
What is the output?
The output is:
Copy CodeThe code is as follows:
Abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalamanaoapaqaras .....
Why?
In
Note: Visitfile () has minor modifications
Copy CodeThe code is as follows:
View files for a specified folder
$fileList = Array ();
function Visitfile ($path)
{
Global $fileList;
$path = str_replace ("\ \", "/", $path);
$fdir = Dir ($path);
while (
such as the default submit button: onclick= "Ajaxpost (' Formid ')"; sort of, we can do this first.
Onclick= "$ (' __formid '). innertext= '; Ajaxpost (' formid '); Checkpostresult ();";
The meaning is actually very simple, first the Ajaxpost tip
PHP Version:
Copy CodeThe code is as follows:
/**
* Delete logs from 7 days ago
* @param $logPath
*/
function Del7daysagolog ($logPath) {
if (empty ($logPath)) return;
$handle = Opendir ($logPath);
while (($file = Readdir ($handle))!== false)
From. NET to do PHP4 years, and recently began to pursue high performance ~ ~
So I started to think it was time to write a blog.
Come and find something first ~
Copy CodeThe code is as follows:
$arr = Array (
' Attr1 ' = 1,
' Attr2 ' = 1,
' Attr3 '
First file login_frm.php This is the login windowCode
Copy CodeThe code is as follows:
The second file login.php This is the process login
Copy CodeThe code is as follows:
if ($_post[' username ') = ' admin ')
{
Setcookie (
Alert hint
Function alert ($msg) {
echo "";
}
Convert some pre-defined characters to HTML entities
function D_htmlspecialchars ($string) {
if (Is_array ($string)) {
foreach ($string as $key = = $val) {
$string [$key] = D_htmlspecialchars ($val);
}
}
Here is an easy way to log in directly using Discuz's include/common.inc.php.
Copy CodeThe code is as follows:
Include_once (".. /discuz/include/common.inc.php ");
$CTDF _userinfo = Array ();
$CTDF _userinfo["sid"] = $sid;
$CTDF _userinfo["UID"] = $
Code:
Copy CodeThe code is as follows:
$a = Array (' a ' = = ' A ', ' B ' = ' B ');
$b = Array (' c ' = = ' C ', ' d ' = ' d ');
$c = $a + $b;
Print ('
Print ('');
?>
Results:
Copy CodeThe code is as follows:
Array
(
[A] = a
[B] = b
[C] = C
[d]
The following is a code example.
Copy CodeThe code is as follows:
$nid = $row->nid;
$country = Db_result (db_query (' SELECT name ' from {term_data} term_data JOIN {term_node} term_node on term_node.tid = Term_d Ata.tid WHERE Term_data.vid =%d and
And, in the course of execution, if one of the executions fails, you can roll back all the changed operations. If the execution succeeds, the sequence of operations will be permanently valid. The transaction solves the problem of being out of sync
Install PHP Extensions: memcache steps under Windows
1. Download the PHP extension dll:http://downloads.php.net/pierre/
(If the above directory does not conform to your PHP compiled version of the DLL to go to Google, there will be a lot of
I am an ASP programmer, this is the first time to write a PHP program, a little bit of experience sent up to share
Copy CodeThe code is as follows:
$ip 2id= Round (rand (600000, 2550000)/10000); The first method, the direct generation of
$ip 3id=
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