PHP Gets the native IP (remote IP address)

Example, PHP gets the user IP address. 111111111111 echo $_server[' REMOTE_ADDR ']; 2222222222222 function Get_local_ip () { $preg = "/\a (([0-9]?[ 0-9]) | (1[0-9]{2}) | (2[0-4][0-9]) | (25[0-5])) \.

To traverse all file and folder methods under a folder five

traverse all files and folders under a folder function List_dir ($dirpath) { if ($dirpath [strlen ($dirpath) -1]!= "\ \") {$dirpath. = "\ \";} static $result _array=array (); if (Is_dir ($dirpath)) {

PHP uses Session_destroy () to delete session data

Session_Start (); Session_register ("A"); Session_register ("B"); Session_register ("C"); $A = "AAA"; $B = "BBB"; $C = "CCC"; $result = Session_destroy (); if ($result =1) {

Smarty Examples of pagination

@session_start (); Require_once ("smarty.php");//load Smarty template class Require_once ("adodb/adodb.inc.php");//Load ADODB Database Connecting to a database $dbhost = ' localhost '; Database server $dbuser = '

Different uses of the PHP median operation (bitwise and, bit, or)

What is the role of bitwise-and-bitwise, or in the development process of PHP? /** * 1. Permission application * What permissions you have, add up the values corresponding to these permissions * For example:

Verification code File Class

Verification code File Class /** * @file * @version 1.0 * @author Net Prodigal * @date 2006-3-30 * @email [Email]sxf02615@163.com[/email] * @brief Verification code file class * */ ?>

In-depth understanding of ZF distribution cycle (dispatcher working principle)

Public Function fooaction () { Forward to another action on the current controller and module: $this->_forward (' bar ', NULL, NULL, array (' baz ' = ' bogus ')); } Public Function baraction () {

A function of converting UBB code

Unction ubb2html ($content) { Global $article; is automatically recognized if ($article [' isparseurl '] = = "1") { $content = parseURL ($content); } Automatic recognition End $content =

PHP Encoding conversion function (automatic conversion character set supports array conversion)

Automatic conversion character set supports array conversion function Auto_charset ($fContents, $from = ' GBK ', $to = ' utf-8 ') { $from = Strtoupper ($from) = = ' UTF8 '? ' Utf-8 ': $from; $to = Strtoupper ($to) = = ' UTF8 '? ' Utf-8

How can php restrict pages to be accessed only in WeChat with a browser?

Restricted programs can only be browsed inside, the following is the PHP limit page can only be accessed from the browser code.In order to prevent their hard-working webapp was copy, want to restrict the program only in the inside, although the

PHP subistr Intercept String Uncensored

ord

Update Time: 20120102 /** * [Webodmin] (C) 2010-2099 Blank Inc. * This was not a freeware, use was subject to license terms * **/ function Subistr ($string, $length, $dot = ' ... ') {

PHP version for a friendly time display (ex: 2 hours ago)

Full PHP class, usually I will cooperate with smary use, quick use (plugins/function.rdate.php) /* * Data time functions. * Module */ Defined (' Tsky ') | | Die (' Permission denied! '); function

Curl Remote Get Verification code

Curl Remote Get Verification code $CookieFile =tempnam ("./tmep", "Beast"); if (Isset ($_get["img"])) { $url = ' http://www.yto.net.cn/Controller/ValidateCode.aspx ';//Verification Code code $ch = Curl_init ($url);

The use of learning error_reporting

Error_reporting in the use of PHP programming frequency, presumably everyone is very clear, this article introduces the usage of error_reporting, for everyone to learn the reference. If the parameter level is not specified, the current error levels

A simple PHP access counter

Start at the top of the page since we start a session Session_name (' Mysite_hit_counter '); Session_Start (); // $FN = ' hits_counter.txt '; $hits = 0; Read current Hits if ($hits = file_get_contents ($FN))

DBO Form Widget

This is a very useful component that can be used to generate an edit form of the data, which is a very important component of the MST Library 3.1, which enables the loop nesting of the dbo form and the dbo form, is controlled in a form, and supports

PHP header () function use detailed

Note: No matter how many headers the page has, it executes the last one, but is conditional, for example: Header (' location:http://bbs.it-home.org '); Header (' location:http://www.g.cn '); Header (' location:

A class for a PHP call database

Class DataBase { var $pConnect =false;//whether to use long connections var $mHost;//Database Host var $mDatabase; var $db; Database var $mUser;//Database user name var $mPwd;//database user password var

Relative Time function

function Relativetime ($time = false, $limit = 86400, $format = ' g:i A M JS ') { if (Empty ($time) | | (!is_string ($time) &&!is_numeric ($time))) $time = time (); ElseIf (is_string ($time)) $time = Strtotime ($time); $now =

PHP's Auxiliary function function

Some auxiliary functions of PHP: mysql_client_encoding () MySQL _get_server_info () Mysql_get_host_info () Mysql_get_client_info () Mysql_stat () Example: !--? php $link =mysql_connect ("localhost", "root",

Total Pages: 5208 1 .... 2254 2255 2256 2257 2258 .... 5208 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.