PHP Four ways to get web content

This article introduces four ways to get web content using PHP, including XMLHTTP method, File_get_contents method, fopen method, curl method. Refer to a friend who needs it.1, use the XMLHTTP object, similar to the ActiveXObject object in ASP. Code:

PHP to write Excel file implementation code

This article introduces the implementation of the code in PHP to write Excel files, including the title and content. Refer to a friend who needs it.PHP writes Excel files, including headings. This is often used in daily development, such as a number

PHP Session function set

This article summarizes some of the PHP Session-related functions, there is a brief explanation, the need for friends, can be collected, in case of a rainy future. The PHP session function set, as follows: Session_cache_expire functions: Gets or

PHP gets the code for Remote Web page content

This article introduces, PHP implementation of the acquisition of Remote Web page content of several methods, including fopen, curl, the need for friends to refer to it.Share several snippets of PHP code to get the contents of a remote Web page. 1,

PHP Cookie counter example using cookies to create counters

/** * Cookie Counter Instance * by bbs.it-home.org * date:2013-9-29 */ if (!isset ($_cookie[' visits ')) $_cookie[' visits '] = 0; $visits = $_cookie[' visits ') + 1; Setcookie (' visits ', $visits, Time () +

A small example of an XLS file generated by PHP

Include '. /.. /inc/auth.php '; Include '. /public/base.php '; Include '. /public/boonlist.php '; The above is the code of the PDO connection database, we do it by ourselves. Header (' Cache-control:no-cache, Must-revalidate ');

PHP Export and read the implementation code of CSV file

$users = File ("./democsv.csv"); foreach ($users as $user) { List ($name, $email, $phone) = Explode (",", $user); echo "$name ($email) Tel. $phone"; }//edit by bbs.it-home.org ?> A,a@example.com,1111

PHP lists the implementation code for all subdirectories in the directory

!--? php /** * Take out the reference All subdirectories of the directory * edit:bbs.it-home.org * 2013/10/9 */ function Listdir ($dir) { if ($handle = Opendir ($dir)) { $

A detailed explanation of PHP function Spl_autoload_register usage

Class a{ Public Function __construct () { Echo ' Got it. '; } } Copy CodeThen, there is a index.php need to use this class A, the general wording: Require ('

Examples of use of set_magic_quotes_runtime () and GET_MAGIC_QUOTES_GPC ()

Echo GET_MAGIC_QUOTES_GPC (); Detection, Output 0 Echo Tiny_mce_marker post[' name ']; Jason ' name Echo Addslashes ( Tiny_mce_marker post[' name ']); Jason\ ' name if (!GET_MAGIC_QUOTES_GPC ()

Phpexcel importing Excel into the database code

This article shares, PHP use phpexcel Import Database code, interested in studying Phpexcel friends to make a reference, or good.Phpexcel implement the import into the database, the code is as follows: '; $objReader = Phpexcel_iofactory:

PHP intercept Chinese string without garbled (ord (), substr () function)

In this article, we introduce two functions, namely the Ord () function and the substr () function, which are not garbled in the Chinese string in PHP. Refer to a friend who needs it.In PHP programming Note: According to the UTF-8 encoding

Use of the mysql_fetch_array () function in PHP

This article describes the use of the mysql_fetch_array () function in PHP, which returns data query results as an array. Refer to a friend who needs it.PHP Data query result function: mysql_fetch_array () function. Returns the data query result as

Examples of Func_num_args and Func_get_args functions in PHP

This article introduces the two functions of variable function parameters in PHP, which are Func_num_args and Func_get_args functions, with the reference of a friend in need.First look at the Func_num_args function.Function: Returns the number of

How PHP gets the MD5 sequence value of a directory

This article describes the use of PHP code to get the MD5 sequence value of a directory, share a piece of code, for the needs of friends reference.PHP gets the MD5 sequence value of the directory. Code: Read ())) { if ($entry! = '. ' && $

PHP Gets the implementation code for the value in the text box

Copy CodeUse of text boxes: Copy CodeWhere input type includes text, password, and so on. After filling in the form submission: if

PHP Infinite Pole Classification (recursive function) code

This article introduces PHP with recursive function to implement an infinite pole classification code, there is a need for friends reference learning under.PHP Infinite Pole Classification, recursive function implementation, the code is as follows:

The usage of PHP ob_start () cache function is detailed

In this article, the use of the function Ob_start () used in PHP for cache control is described below.In PHP, the Ob_start () function is used to open buffers, such as the header () function, if there is an output, including a carriage

PHP Call the implementation code of Yahoo Sina API weather forecast

Header (' content-type:text/html; charset = Utf-8 '); Class Weather { static $url = ' http://xml.weather.yahoo.com/forecastrss?u=c&w= '; static $city = ' Beijing '; Default City Beijing It's important to note that cities want to fill

Learn the conversion and judgment of PHP string encoding

This article introduces a code for transcoding and judging the string encoding in PHP programming, and a friend in need can take a reference. In PHP, it is often necessary to implement GBK and UTF-8 encoding transformations, such as the Json_encode

Total Pages: 5208 1 .... 3631 3632 3633 3634 3635 .... 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.