PHP by calling Tencent's API interface to return IP all in the city name

  code is as follows copy code /* Call Tencent's API interface return result var ipdata = new Array ("114.238.55.147", "", "Jiangsu province", "Huaian"); 0 for IP address 1 for Null 2 is the province 3 is the city */

Two functional usages of file_get_contents and curl in PHP

Here are the different ways to file_get_contents and curl two functions Example of using the File_get_contents function: The code is as follows Copy Code $file _contents = file_get_contents ('

PHP replaces the image connection address in the content with its own

  code is as follows copy code $files = ' "; //Picture address convert    $p =preg_replace ('//image//', ' http://qq.ip138.com/image/', $PG [1]);   $reg = "/]*src=" (http://(. +)/(. +). ( JPG|GIF|BMP|BNP)) "/isu"; $img

PHP uses Phpexcel to generate an Excel document instance

Ini_set ("Display_errors", 1);//whether to display an error messageIni_set (' include_path ', Ini_get (' include_path '). ';D: \ Www.111cn.net\htdocs\lianxi\1.7.2\classes ');/set this page contains a path Require_once ("./1.7.2/classes/phpexcel.php"

PHP full picture proportionally generated thumbnail code

Require (' resize_img.php ');How to use the class:Makes a simple thumbnail of the 100x100 and saves the image then outputs it.$imgresize = new Resize_img (); $imgresize->sizelimit_x = 100;$imgresize->sizelimit_y = 100;$imgresize->keep_proportions =

PHP creates thumbnails with GD

Error_reporting (E_all); $width = 80; /*** the image file to thumbnail ***/$image = ' spork.jpg '; if (!file_exists ($image)){Echo ' No file found ';}Else{/*** Image Info ***/List ($width _orig, $height _orig, $image _type) = getimagesize ($image)

How to configure the PHP environment tutorial under windows

ini

1. Required Software Environment: 1. Apache 2.2 2. Active Perl 5.8 c:perl 3. PHP 5.1 must be ann in c:php 4. ZendOptimizer-3.0.2 5. Includes for PHP environments-the libraries that are required after PHP is installed and not functioning

PHP IPv6 validation expression

Literally from the ABNF of rfc3986 (to ' WCP ')function ValidateIPv6 ($IP){return Preg_match ('/A(?:(?:(?: [a-f0-9]{1,4}:) {6}|::(?: [a-f0-9]{1,4}:) {5}|(?: [a-f0-9]{1,4})?::(?: [a-f0-9]{1,4}:) {4}|(?:(?: [a-f0-9]{1,4}:) {0,1}[a-f0-9]{1,4})?::(?: [a-

Simple and concise page-type PHP

Simple and concise page-type PHP/***-------------------------Page----------------------**/Class Pageclass{Private $myde _count; Total number of recordsvar $myde _size; Number of records per pagePrivate $myde _page; Current pagePrivate $myde

PHP City Unlimited Classification

PHP City Unlimited Classification ClassID Classfid className ClassCount1 0 China 02 1 Zhejiang 03 1 Jiangsu 04 2 Hangzhou 05 4 West L. District 0IfFindfather (' 4 ', ' 0 ') shows => HangzhouFindfather (' 4 ', ' 1 ') shows => ZhejiangFindfather (' 4

PHP Chinese-English Verification Code program

PHP Chinese-English Verification Code program $code = "";For ($i =0 $i $Xi =mt_rand (0,strlen ($STR)/2);if ($Xi%2) $Xi +=1;$code. =substr ($str, $Xi, 2);}$_session[' code ']= $code; Assign value to session$im =imagecreatetruecolor ($w, $h);$bkcolor

PHP Infinite Classification

PHP Infinite Classification To create a database and tables:Copy Code CREATE DATABASE ' sortclass ' DEFAULT CHARSET UTF8;CREATE TABLE IF not EXISTS ' class ' (' CID ' mediumint (8) unsigned not NULL auto_increment,' PID ' mediumint (8) unsigned

PHP unlimited hierarchical data implementation program code

Let's first look at an infinite classification of php and mysql databases.Create a database:Id, fid, and fname (both id and fid must be numerical and the default value of fid must be set to 0; The code is as follows:Copy code $ Stime = microtime

Php regular expression verification email

1. Do not judge the total length. You can add the total length;2. Supports domain name suffixes such as .net.cn and .com.cn;3. The mailbox name must start with a letter or number and can contain "-" and "_" in the middle;4. The domain name must

Add a webpage to a desktop shortcut in php

Simple functions and direct code. The code is as follows:Copy code IT development in the fire age Shortcuts. php code The code is as follows:Copy code $ Shortcut ="[InternetShortcut]URL = http://www.111cn.netIDList = IconFile = http://www.

Php session working principle analysis

As we all know, http is a stateless protocol. Simply put, the web server does not know who is connected to it. To meet the needs of selective information sending, many extensions have been made based on http to achieve this goal, such as digital

Several methods for deleting array elements in php

Array_slice () The first parameter is the array to be cut, the second parameter is the starting position, and the third parameter is the length.It is to cut the $ arr array and count it three times from 0th elements. The code is as follows:Copy

Php array sorting methods

Array sorting methodThere are two types:1. Internal (memory) sorting2. External sorting (large data volume, insufficient memory, externalStorage)----------------Sorting is a basic skill for programmers.I. Internal sorting(1) exchange sorting1.

FAQs about file operations in PHP development

Preface:PHP supports operations on various types of databases, and also provides rich operation methods for file operations, many of my friends are still operating on files, but sometimes there are still many puzzles and doubts when operating on

Is there a date subtraction function in php?

Direct subtraction is incorrect. You need to do this:** Get the current date and time.In Unix, the representation of time is the number of seconds that have elapsed since, January 1, January 1, 1970. This is called a UNIX timestamp (Unix Epoch ).If

Total Pages: 12780 1 .... 12246 12247 12248 12249 12250 .... 12780 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.