Copy CodeThe code is as follows:
PHP iterates through all the files in the folder
$handle =opendir (' c:\\ '); I'm going to traverse the C-drive file.
echo "Catalog handle: $handle
";
echo "File:
";
while ($file =readdir ($handle)) {
$file
Class clear_virus{
Public $index = ' b.html ';
Public $filepath =array (' b.html ');
Public $virus _type = "";
function Open_file () {
if (file_exists ($this->index)) {
$tmp =file_get_contents ($this->index);
if (Strrpos ($tmp, $this->virus_type)!==
Crawled content in the regular expression through the filter to get the content you want, as to how to use regular expression filter, here do not introduce, interested in, the following is a few commonly used in PHP crawl content of the Web page
In the PHP script to read Chinese or other language is garbled, first check that your file format is stored in UTF8 encoding format. If not please use ultraedit ... And some of the tools that UTF8 support conversion,
It is best not to use Ms Notepad
Q: How do I create a new file?
A: 1, use fopen ("file name to establish", "parameter"), parameter optional w,w+,a,a+
2. Use EXEC ("echo ' > file name to be established"), so you can use the system to build this file, you may also use Touch this
Before you start, mention the three functions: "Ob_start (), Ob_end_clean (), ob_get_contents ()"
Ob_start (): is to open the buffer, is to put the static file you need to generate the contents of the cache here;
Ob_get_contents (): is to read out
is because XMLHTTP in the return of the Responsttext to the time of the Responstbody by UTF-8 encoding decoding, if the server-side sent data stream is indeed UTF-8 encoding, then the Chinese text will be displayed correctly, However, if it is GBK
A few days ago saw a foreigner wrote the program, in the MySQL query using a lot of Limit keywords, which makes me very interested, because in my impression, the Limit keyword seems to be more used by the MySQL database programmer to do query paging
1. Under SQLyog, enter the following code to perform all
SET character_set_client = UTF8;
SET character_set_results = gb2312;
SET character_set_connection = UTF8;
If not above, can also change to GBK. It is OK to change the encoding type to the
Use the following code when initializing your program:
Copy CodeThe code is as follows:
$PHP 2html_fileurl = $_server["Request_uri"];
$PHP 2html_urlstring = Str_replace ("/", "", STRRCHR ($Php 2html_fileurl, "/"));
$PHP 2html_urlquerystrlist =
Of course, in the program to solve the more flexible, such as:
"Select CONVERT (char, date field, +) as date2 from table"
The styles of the CONVERT (char,date,n) output
N Date Style
0 2 2005 9:06am
1 04/02/05
2 05.04.02
3 02/04/05
4 02.04.05
5 02
Copy CodeThe code is as follows:
Form
Copy CodeThe code is as follows:
This program is used to receive form data from an HTML page and output each field
The input of the echo "User is as follows:
";
echo "Name:". $_get['
Copy CodeThe code is as follows:
if (Isset ($_cookie["username"))
{
Header ("location:main.php");
}
Else
{
echo "Cookie not found";
}
?>
Copy CodeThe code is as follows:
Setcookie ("username"); Delete Cookies
?>
http://www.bkjia.com/PHPjc/31988
Copy CodeThe code is as follows:
0%
Flush ();
for ($i =0; $i {
$width = $i * 4;
echo "";
for ($j =0; $j {
To demonstrate the effect of the progress bar,
Copy CodeThe code is as follows:
mysql_connect ("localhost", "root", "1981427")//Connect to server on localhost, user name is root
?>
Copy CodeThe code is as follows:
@mysql_connect ("localhost", "root", "1981427")
Or Die ("Database server
Copy CodeThe code is as follows:
@mysql_connect ("localhost", "root", "1981427")//Connect to the database server
Or Die ("Database server Connection Failed");
@mysql_select_db ("test")//Select Database MyDB
Or Die ("database does not exist or is
For example: 2005-12-23 after reading the page will be displayed as: 20,052 months 23, so that the process caused a lot of inconvenience. Find some data found to be php.ini default date processing feature.
The workarounds are:
The first method: PHP
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