Some PHP common regular expression collection

"^/d+$"//non-negative Integer (positive integer + 0)"^[0-9]*[1-9][0-9]*$"//Positive integer"^ ((-/d+) | (0+)) $ "//non-positive integer (negative integer + 0)"^-[0-9]*[1-9][0-9]*$"//Negative integer"^-?/d+$"//Integer"^/d+ (/./d+)? $"//nonnegative

PHP header () force file download implementation code

The code is as follows Copy Code function DownloadFile ($file) {$file _name = $file;$mime = ' application/force-download ';Header (' Pragma:public '); RequiredHeader (' expires:0 '); No cacheHeader (' Cache-control:must-revalidate,

PHP page function application and implementation of the principle of detailed

The 13th teacher provided the paging function, I made the appropriate changes, removed some I do not understand the place.As long as you study the teacher's function well, it is very easy to judge the place that I have changed.If you feel that I

PHP Unlimited Class Classification program

The code is as follows Copy Code $a = Array (' Aaaaaa ' => Array (' Aaaaaa ' => Array (' 111111 ',' 222222 ',' 333333 '),' BBBBBB ' => Array (' 111111 ',' 222222 ',' 333333 '),' CCCCCC ' => Array (' 111111 ',' 222222 ',' 333333 '),)

PHP Breakpoint Renewal Program

function Sendfile ($myFile) { $MM _type= "Application/octet-stream"; $fp = fopen ($myFile, ' RB '); $size = FileSize ($myFile); Ob_start (); Header ("Cache-control:public, must-revalidate"); Header ("Pragma:hack"); Header ("Content-type:").

PHP get URL address perfect code

function getServerName (){$ServerName = strtolower $_server[' server_name ']?$_server[' server_name ']:$_server[' http_host ']);if (Strpos ($ServerName, ' http://')){Return Str_replace (' http://', ', ', $ServerName);}return $ServerName;}Instance

PHP Data Group Add, delete, query, sort detailed description

The addition of an array (the top and end data are added (without limiting the number of bars) and the data operation is added anywhere in the middle).2~ the deletion of the array (the end of data deletion (not qualifying), as well as data deletion

PHP while syntax and instances

The while statement executes a block of code if the specified condition evaluates to True. If the condition becomes false, in the loop Stops execution and controls the loops that are passed to the statement after the statement. The syntax for the

Classic PHP Pagination Class-PHP General Page class

Class my_lib_pages{Private $each _disnums;//The number of entries displayed per pageprivate $nums;//Total number of entriesvar $current _page;//the currently selected pagePrivate $sub _pages;//The number of pages per displayprivate $pageNums;//Total

PHP multiple File Upload

This script uploads multiple files at a time. For uploading multiple files at a time, first create an upload according to the specified number of file tables. When you create a table, the files should be posted separately in each row and column.

PHP Chinese character Verification Code instance code

PHP Chinese character Verification Code instance code Header ("Content-type:image/png"); $str = " One is in the not big this is the main people on the ground for a labor to move domestic to me to he will do to the school subordinate on the annual

Getting Started tutorial-php function $_server

$_server[' php_self ': The name of the file that is currently executing the script, related to document root. $_server[' argv ': arguments passed to the script. $_server[' argc ': Contains the number of command-line arguments that are passed to the

Insert an element program code to the array in php

The code is as follows:Copy code /*** Insert an element into a two-dimensional array in reverse order* * @ Author WadeYu* @ Date 2012-05-30*/$ ASorted = array (Arrays (1,100 ),Array (2, 90 ),Array (3, 80 ),Array (4, 70 ),Array (5, 60 ),Array (6, 5

Explanation of php paging methods

You only need to get two variables to get half done:Number of records to be displayed per page $ pageSizeTotal data volume in the table $ rowCountWith the above two variables, we can get a total of several pages. $ pageCountThen, through the for

Configure the image upload function for Ckeditor and Ckfinder in PHP

1. Install and configure CKEditorBefore expanding CKfinder to upload images, we should first install the most basic CKeditor editor.1. Decompress the downloaded ckeditor_3.4.2.zip file and copy the ckeditor folder in the directory to the desired

How to implement page jump using header () in php

302 temporary redirection for headers The code is as follows:Copy code Header ("HTTP/1.1 302 Found ");Header ("Location: http://www.111cn.net "); The page cannot be found because the header is 404 The code is as follows:Copy code Header

How to save the php code to the php file

  The code is as follows:Copy code Function cacheArr (& $ data ){If (! $ Data) throw new Exception ('Array cannot be blank ');Foreach ($ GLOBALS as $ key => $ value ){$ Str = $ GLOBALS [$ key];$ GLOBALS [$ key] = 'changed ';If (& $ data =

PHP knowledge summarized by myself

I have never learned PHP before. I have recently used a new project, so I decided to learn and make PHP.1. You can add restrictions in SQL statements: left (text, 20) only takes the first 20 words of text;2. limit fromRecord and RecordNum can be

Nine unpleasant reasons for PHP on large systems

I have been developing PHP applications for the past four years. PHP is indeed very easy to write. However, PHP also has some very serious defects.Next I will give my reasons why PHP is not suitable for websites larger than small and amateur

Connection to SQLServer2005 code in PHP and FAQs

Configure the system before connection:1. Check that the php5.2.5/ntwdblib. dll file contains one by default, which cannot be connected and replaced.Download the correct version of ntwdblib. dll (2000.80.194.0), Address:

Total Pages: 12780 1 .... 5653 5654 5655 5656 5657 .... 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.