PHP header Content-type Type summary _php tutorial

Copy CodeThe code is as follows: $mimetypes = Array ( ' EZ ' = ' application/andrew-inset ', ' hqx ' = ' application/mac-binhex40 ', ' CPT ' = ' Application/mac-compactpro ', ' Doc ' = ' Application/msword ', ' Bin ' = ' application/octet-stream ',

PHP Lazy Person function automatically add data _php tutorial

Copy CodeThe code is as follows: /* *@ Adding data functions automatically *@ $table Table Name *@ $arr Word Snippets Array ("title", Array ("content", int)) *@ Array (field, type) *@ type description html--Allow HTML unhtml-HTML is not allowed int--

Template class _php tutorials from Kang Sheng Products (discuz)

Copy CodeThe code is as follows: /*template.class.php @ Kang Shengweibo Template Extraction class think this template useful to spend some time independent out. by Rezhigin @ have a look at CTT this template is similar to Phpcms's template?? ^_^

PHP Skymvc a lightweight, simple php_php tutorial

The framework is mainly used to realize the collaborative development between multiple programmers and the implementation of MVC development pattern. SKYMVC The MVC development approach, the framework itself is easy to expand. SKYMVC as the basic

Note Sharing _php tutorial on object objects in PHP

1. When all instances are set to null,php, the object's references are automatically cleared. 2. Construction Sub: __construct () Methods to be executed automatically when objects are purged: __destruct () You can also set methods for manually

PHP string Regular replacement function preg_replace instruction _php Tutorial

1. Preg_replace () $msg = Preg_replace ("/ And the middle part $msg = Preg_replace ("/]+>/", "", $msg); -----is to delete <> and intermediate content I (pcre_caseless) If this modifier is set, the characters in the pattern will match the uppercase

PHP design mode Factory (Factory mode) _php Tutorial

Copy CodeThe code is as follows: /** * Factory Method mode * * Define an interface for creating objects, let subclasses decide which class to instantiate, defer to its subclasses with instantiation of a class */ /* Class Dbfactory { public static

The idea and implementation of the automatic numbering of php new files _php Tutorial

Requirements: In the system in the new file is can be implemented automatically numbering. For example, the default file name for a new text file is: New text document. txt, if the file name changes automatically when you continue to create new text

PHP to get the JSON data in post _php tutorial

Suddenly think of the previous contact Flash will picture binary stream to PHP, brainwave with $globals[' http_raw_post_data '] get to. So in-depth check, the original PHP default only recognizes the application/x-www.form-urlencoded standard data

Implementation code to determine the end of an HTTP request for Keep-alive mode _php tutorial

So you can judge the end of a request based on EOF, the following code (PHP) is common: Copy CodeThe code is as follows: $FP is a handle produced by Fsockopen () while (!feof ($fp)) { Echo fgets ($FP); } (Note: The short connection mode is marked

Common methods of PHP functions and the point of attention summary _php tutorial

Copy CodeThe code is as follows: /** * @author Yuans * @copyright php.com * @package function of the common use of methods and characteristics. */ # base function writing note points. To facilitate the management of the IDE and the code hinting

PHP properly configured MySQL (Apache environment) _php Tutorial

Wrote a test for MySQL PHP file as follows: Copy CodeThe code is as follows: $link =mysql_connect (' localhost ', ' root ', ' root '); if (! $link) echo "Failed!"; else echo "Success!"; Mysql_close (); ?> Results reported error: Fatal error:call

php.ini date.timezone Setup Analysis _php Tutorial

Although it is known that this parameter means "People's Republic of China", but the official document does not have such parameters, only Asia/shanghai, Asia/hong_kong and so on these parameters ah, why here can be set to RPC, which is the point of

PHP Whois Query API Authoring Method _php Tutorial

Here we obtain data from the data interface of WAN or new network, and then output it through the simple text processing of PHP. Copy CodeThe code is as follows: $domain = $_get[' Q ']; Preg_match ("| (.+?) |is ", @file_get_contents (' http://

PHP XPath to XML file find and modify implementation Code _php tutorial

Copy CodeThe code is as follows: /* 11 Content1 2009-10-11 Title2 Content2 2009-11-11 */ if (!function_exists (' l ')) { function L () { Echo ' **

PHP module memcached function more than memcache_php tutorial

cas

For example, there are two memcached modules in Pecl, Memcache and memcached, most of the current PHP environment is using the Memcache version without d in the name, this version released earlier, is a native version, The corresponding memcached

A PDO-based database operation class (new) A PDO transaction instance _php tutorial

Copy CodeThe code is as follows: /* * Author: Hu Rui * Date: 2011/03/19 * e-mail: hooray0905@foxmail.com * * 20110319 * Common database operations, such as: Add or delete changes, get a single record, multiple records, return to the latest one

PHP code for bulk deletion of data tables with the same prefix in MySQL _php tutorial

Method One: Copy CodeThe code is as follows: Mysql_connect (', ', ', '); mysql_select_db ("); $rs =mysql_query (' Show Tables '); while ($arr =mysql_fetch_array ($rs)) { $TF =strpos ($arr [0], ' class_ '); if ($TF ===0) { $FT =mysql_query ("drop

PHP Chinese-English mixed string intercept function code _php tutorial

Copy CodeThe code is as follows: function Get_word ($string, $length, $dot = '.. ', $charset = ' GBK ') { if (strlen ($string) return $string; } $string = Str_replace (', ', ' & ', ' ' ', ' '), Array (' ', ' ', ' & ', ' "', ' '), $string); $strcut

PHP Delete files and folders Operations unlink () and rmdir () the use of these two functions _php tutorial

Check the code first. Copy CodeThe code is as follows: function Deldir ($dir) { Delete the files in the directory first: $DH =opendir ($dir); while ($file =readdir ($DH)) { if ($file! = "." && $file! = "...") { $fullpath = $dir. " /". $file; if

Total Pages: 5208 1 .... 3150 3151 3152 3153 3154 .... 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.