summed up a PHP to get all the links in the page function, the function code is as follows:
/**php get all the links in the page*/function Getpagelink ($url) {Set_time_limit (0);$html =file_get_contents ($url);Preg_match_all ("/]+s*") href= ([\ "|
PHP generates random password functions, when the need to generate random numbers or generate random passwords can be used, the need for friends can refer to, the specific function code is as follows:
PHP generates random number cipher function
PHP Gets the current page full real URL address method, including parameters, summed up three methods, you can choose according to the needs, the specific function code is as follows:
The first method:
function Getcururl () {if (Isset ($_server['
PHP Gets the size of the remote file, with the following code:
/** * Function: Gets the size of the remote file, the unit of return value is: bytes*/function Get_filesize ($url) {if (!isset ($url) | | Trim ($url) = = ") {Return ';}Ob_start
There are two functions in PHP--at least two are there any other I do not know, can achieve the digital 0 format, Str_pad (), sprintf () Now the two functions are analyzed in detail:
Str_pad as the name implies, this function is for strings. This
PHP Cache page functions.
/*****************************************************************--Function Name: Cache_page (including Cache_page_go)--function: Easy and fast Cache full station--Parameters: Cache time (in seconds)--return value:
PHP deprecated:directive ' MAGIC_QUOTES_GPC ' is Deprecated in PHP 5.3 and greater in Unknown on line 0
Starting with PHP 5.3, to better transition to a future version of PHP (PHP6), Mark functions that are no longer supported in the future as
The code is as follows:
Header (' content-type:text/html; Charset=utf-8 ');$online _log = "Count.dat"; Save the number of documents,$timeout = 30;//30 sec No move author, think drop line$entries = File ($online _log);$temp = Array ();for ($i =
When the Linux system installed lamp to run the Web site, found in www.xxx.com/index.php call include () can not refer to the root of the first level of PHP files, can only refer to the root directory of PHP files.
Originally in Window system is
PHP infinite Pole classification is often used, a simple PHP infinite pole classification code is as follows:
Data table structure
CREATE TABLE IF not EXISTS ' category ' ( ' id ' int (5) is not NULL auto_increment COMMENT ' unique self-increment
Array Str_split (string $string [, int $split _length = 1])
Str_split returns an array, the first argument is the string type that represents the strings to be grouped, the second argument is the init type, it is grouped by several characters, and
Use PHP to filter the code in HTML that might be exploited to introduce external dangerous content. Sometimes, you need to let users submit HTML content in order to enrich the information that users post, of course, some may cause the Display page
This is a simple voting procedure, for just learning PHP and friends is a very good entry program. Here to introduce you, hope to be helpful to friends.
The system is composed of the following four files: The survey.htm of the HTML survey form, the
PHP Regular execution of small code, switch off the browser, PHP script can continue to execute!
Ignore_user_abort ();//switch off the browser, PHP script can also continue to execute set_time_limit (20);//program timeout, unit seconds, through
The following is the source code of PHP generated verification code:
Session_Start ();Session_register (' Checkcode ');PHP4.2 not required to register session variable with Session_register ()$type = ' gif ';$width = 45;$height = 20;Header ("
error_reporting Definition and usage
Error_reporting () Sets the error level for PHP and returns the current level. Syntax error_reporting (report_level) If the parameter report_level is not specified, the current error level is returned.
The
For the sake of the security of the program, in some cases we will need to detect whether a request is an AJAX request, how to judge it?
This article will briefly share the experience.
1. When using native JavaScript to make AJAX requests, we can
In
PHPIn
strlenAnd
Mb_strlenTwo functions are used to find the length of the string, but also in our daily work is often used in one of the functions, although not difficult to understand, but for some beginners, if you do not read the manual, it
Using PHP to calculate a function that is currently the week of the year or January, you can certainly customize the time of the first day, and then calculate the time that is relative to the first day of the customization, the current time is the
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