PHP Get guest Client extranet IP
This can record the visitor's IP for statistics ah what. This code is super nice! Good to use and listen to the correct access to the user's physical address or something!
Here's the code.
Class Get_gust_info
The filter function in PHP is a general term for a series of functions, including the Filter_var function in the Filter series function. The filter series functions are part of the PHP core. These functions can be used without installation.
He is
Correctly understand cookies and session mechanisms
The difference and connection between cookie and session mechanism in PHP
Specifically, the cookie mechanism uses a scheme that maintains state on the client. It is the storage mechanism of
Regular expression of this thing, learning is still a bit difficult, the key is to continue to use in the actual combat, a month without, basically quickly unfamiliar. The author has this painful experience, so for this thing, or by accumulating! As
Using Tbszip to manipulate Zip compressed files
Tbszip is a PHP class used to read and write zip archive packages that do not require PHP extensions or temporary files.
Tbszip can read, write, modify, and delete files in a compressed document.
/*
PHP implementation of the file download function, the specific function code is as follows:
function Download ($file _url, $new _name= ") {if (!isset ($file _url) | | Trim ($file _url) = = ") {Return ' 500 ';}if (!file_exists ($file _url))
1, PHP interface class: interfaceIn fact, their role is very simple, when a lot of people to develop a project, it may be to call someone else to write some of the classes, then you will ask, how do I know how the implementation of one of his
This article will summarize how PHP obtains the file extension, which is the file suffix name method. This gives only the most correct way to get the file extension (file suffix name) using PHP.
function Get_extension ($filename) {Return PathInfo
PHP Extra Large File download, breakpoint continued download
Export order information when a PHP memory overflow problem, the reason is that the download time to read the generated temporary file is too large, PHP memory can not be accommodated, in
PHP 5.3 or later, using the pthreads PHP extension, you can make PHP really support multi-threading. PHP multithreading in the processing of repetitive cyclic tasks, can greatly shorten the program execution time.
As I said in my previous article,
Php5.0 has provided us with a lot of object-oriented features since its release, especially for our easy-to-use magic methods that allow us to simplify our coding and better design our systems. Today we will come to know the Magic method that php5.0
Share a piece of code that uses PHP to save the URL shortcut to the desktop, do not know why I do not use UrlEncode in 360, the Chinese file name will be garbled, and in Firefox must use UrlDecode, using UrlEncode will also cause the file name
1. The register stop function has a function called register_shutdown_function (), which allows you to run the code before the entire script is stopped. Let's look at one of the following examples:
Capture the start Time$start_time = Microtime
PHP Whole station Anti-injection program, need to require_once this file in the public file, because now the site is injected attack is very serious, so recommend everyone use, see the following code.
PHP Whole station Anti-injection program,
Sometimes in order to limit a user or an IP user for a period of time the maximum number of operations, we may use MySQL directly record each time the user's record, through the Time field to count the time period of operation to limit, in order to
Magic Method (Magic methods)
PHP's method of starting with two underscores is called a magic method, which plays a pivotal role in PHP. Magic methods include:
__construct (), constructor of class
__destruct (), Destructor for class
PHP XML to array, the XML is converted to an array, the required friends can refer to.
Xml to the array, including the root key function Xml_to_array ($xml) {$reg = "/]*> ([\\x00-\\xff]*) /"; if (preg_ Match_all ($reg, $xml, $matches)) {$count =
In the content station or the product station, in order to better user experience, generally in the content page will give the previous article, the next article link
PHP implementation of the content page of the next article on the function of
Sample code for PHP to determine if a file exists
This content for everyone to explain is PHP to determine whether a file exists, interested students reference learning, the content of this article is as follows:
sha1_file Calculating a text file
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