Introduction to PHP Regular expressions

1. Introduction and function of regular expressions. 01. What is a regular expression? Regular Expressions (English: Regular Expression, regex, or RegExp, abbreviated as RE), also translated as regular representations, general representations, in

PHP uses curl to implement get and post submit data

Curl Implement get Submit data The code is as follows Copy Code Initializes a CURL object$curl = Curl_init ();Set the URL you want to crawlcurl_setopt ($curl, Curlopt_url, ' http://www.111cn.net ');Set header, last

PHP file System-based page Counter example

file System-based page Counter example The code is as follows Copy Code ? Php$countfile = "Num.txt";Defines that the file written by the counter is count.txt under the current directory, and then we should test

PHP Read and write file operation

function Read ($filename, $filesze){$FP =fopen ($filename, "RB");//Fopen RB property read file and unlock with flock Lock_sh,lock_unif ($FP){Flock ($FP, lock_sh);Clearstatcache ();$filesize =filesize ($filename);if ($filesize >0){$data =fread ($fp, $

PHP Statisticians code (number of people in line according to statistics program source)

$time = Gettimeofday (void); Start of file initializationif (@filesize ("Time.Text") $FD _time = fopen ("Time.Text", "w+");Fputs ($fd _time, $time [sec]);Fclose ($FD _time); $FD _time = fopen ("Ip.text", "w+");Fclose ($FD _time); }File

PHP with conditional query paging code

The code is as follows Copy Code if (!isset ($_get[absolutepage])) {$absolutepage =1;//Current Page}if ($_get[absolutepage]==0) {$absolutepage = 1;}else {$absolutepage =$_get[absolutepage];$absolutepage =intval

All pictures and picture addresses in the PHP regular content

The code is as follows Copy Code Method One$body = ' ";Preg_match_all ("/(SRC|SRC) =[" | ' |] {0,} (image/(. *). (gif|jpg|jpeg|png|bmp)) /isu ", $body, $img _array);Print_r ($img _array);Method TwoPreg_match_all ("/src=") (file:///.*

PHP Gets the relative path instance code

The code is as follows Copy Code function Getrelativepath ($a, $b) {$returnPath = Array (dirname ($b));$arrA = explode ('/', $a);$arrB = explode ('/', $returnPath [0]);     for ($n = 1, $len = count ($arrB); $n     &nb sp;   if

Php template writing

/* @ Author: zhuyubing@gmail.com */Class Template {Var $ code;Function Template ($ template ){$ This-> code = implode ('', @ file ($ template ));        }Function assign ($ name, $ var = null ){If (is_string ($ name) & is_string ($ var )){$ This->

Multipart download using PHP

If it is just a normal file download, php is not necessary at all, you can use it. But sometimes, to keep the file confidential, you can only download it to some people. Obviously, you cannot tell others the chaincode, in this case, no

Php ajax XMLHttpRequest POST instance code

The code is as follows:Copy code The code is as follows:Copy code Ajax POST Real POST Person info will be listed here. Php codeHeader ('content-Type: text/html; charset = utf-8 ;');Echo "POST data:". implode ('', file ('php: // input '))

Using php to generate thumbnails [recommended]

Function ResizeImage ($ im, $ maxwidth, $ maxheight, $ name ){$ Width = imagesx ($ im );$ Height = imagesy ($ im );If ($ maxwidth & $ width> $ maxwidth) | ($ maxheight & $ height> $ maxheight )){If ($ maxwidth & $ width> $ maxwidth ){$ Widthratio = $

Php uses cookies to prevent repeated submission. Solution

The principle isIf the data passes the preceding two verifications, the data is valid and valid. At this time, we concatenate the submitted data into a string and use MD5 encryption to obtain an MD5 value. Then we put this value on the client

Url address legality check function in php

The code is as follows:Copy code // Function name: CheckWebAddr ($ C_weburl)// Usage: Determine whether the website is valid// Parameter: $ C_weburl (URL to be detected)// Return value: Boolean// Standby Note: None// Configure //------------------

Php reads all images in the article

The code is as follows:Copy code Preg_match_all ('/

Php obtains the playing time of a music file.

The code is as follows:Copy code $ File = "C:/Users/Public/Music/Sample Music/kalimbaloud "; If (! File_exists ($ file )){Exit ('media file does not exist .');} // Create a Windows Media Player interface$ Player = new COM ("WMPlayer. OCX ");$

Complete php ajax user registration and user name verification instance

insert title here user name: Password: duplicate password: Name: Gender: male Female Age: Mobile Phone: communication address: Email Address: user Photo: date of birth: verification code:

Php compilation of large website problem sets

PHP is quickly promoted with ease of use, but it is not easy to say that it can be used. In fact, many programmers use it to easily establish a WEB application system, but how many people have carefully considered their code, whether it is easy to

Total Pages: 12780 1 .... 12122 12123 12124 12125 12126 .... 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.