The PHP judgment string contains the specified character

Instance One The code is as follows Copy Code $string = "I am ABC";if (Ereg ("Www.111cn.net", $string)) echo "' abc ' is true ";if (Ereg ("^abc", $string)) echo "' ^abc ' is true ";if (Ereg ("abc$", $string)) echo "' abc$

PHP Ajax Paging Program code (1/5)

  code is as follows copy code php Tutorial Ajax Paging program code Home 1 2 3 4 5 last

PHP Paging Code (Practical Paging program)

The code is as follows Copy Code function Pagenavi ($total, $offset) {Global $conf _pagemax;Global $conf _home;Global $conf _pastlog;Global $view;$next = $offset + $conf _pagemax;$prev = $offset-$conf _pagemax;echo "";if ($offset >

PHP reads text file contents

fopen Read File instances The code is as follows Copy Code $path = ' a.txt ';$FP =fopen ($file, "R");//Open file as read-onlywhile (!) ( Feof ($FP))){$text =fgets ($FP);//read a file on one lineEcho $text;}

PHP Extract article content picture address regular expression

The code is as follows Copy Code php Tutorial Extract article content picture address regular expression ?if ($_post){$body = $_post[' body '];Preg_match_all ("/(SRC|SRC) =[" | ' |] {0,} ((.*). (gif|jpg|jpeg|png|bmp)) /isu ", $body,

PHP Authentication User Name Duplicates

  code is as follows copy code $uid = $_ request[' uid ']; Checkusername ($UID); Function Checkusername () {   $title = $uid;  if (Empty ($title))  {   r Eturn false;  }  else  {   mysql tutorial _connect (' localhost ', '

Array Conversion string PHP code

  code is as follows copy code $ Fruits = Array ( "fruits" => Array ("A" => "Orange", "B" => "banana", "C" => "Apple"), "Numbers" => ; Array (1, 2, 3, 4, 5, 6), "holes" => Array ("A", 5 => "second", "third") ); $arr 1 = Array (

PHP File Upload Simple example Application

php File Upload Simple example application The code is as follows Copy Code The Enctype property of the Upload this file: 3.php file The code is as follows Copy Code Move the file

File Upload PHP code (easy to use)

The code is as follows Copy Code function Upfile ($filename, $type, $path){ $tempfile =$_files[$filename];//receive uploaded temporary files There was no upload successif ($error = $tempfile ["Error"]){Switch ($error) {Case 1:

PHP Digital pagination Class code (imitation Baidu page-effect)

The code is as follows Copy Code $conn =mysql tutorial _connect ("localhost", "root", "");$db =mysql_select_db ("Gan");mysql_query ("Set names ' GBK '");?> Untitled Document $url =$_server[' Request_uri '];$url =parse_url

PHP analog user post get source code

If (function_exists (' Curl_init ')) { $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url _with_get); curl_setopt ($ch, Curlopt_post, 1); curl_setopt ($ch, Curlopt_postfields, $post); curl_setopt ($ch, Curlopt_returntransfer, true);

PHP Regular Judge Chinese characters

PHP Tutorial Regular judgment Chinese character $STR = "China";Echo $str;echo ""; if (Preg_match ("/^[". Chr (0XA1). " -". Chr (0xFF)."] +$/", $str)) {//can only be used in gb2312 casesif (Preg_match ("/^[x7f-xff]+$/", $str)) {//compatible gb23

Ajax Simple and ajax+php example applications (1/4)

[Ajax Introduction] Ajax is a Web application development method that uses client script to exchange data with a Web server. Web pages can be updated dynamically without interrupting the interactive process. With Ajax, users can create a direct,

Example of JSON data generated by php

Theme after a long timeThe result shows that there is a problem with the local build.Why don't we bother? (? ^ ?)?When posting in Baidu POST BarJSON is often used to obtain some values.So how does PHP output JSON data?In fact, the 'json _ encoding'

Php compresses and decompress css files

Compressing css code reduces the file size, reduces the amount of network transmission and bandwidth usage, and reduces the processing pressure on the server.Source code: The code is as follows:Copy code $ String = trim (stripslashes ($ _ POST ['

Php Chain of Responsibility Chain mode

For example, when an atomic bomb is dropped, blood may be reduced for troops or buildings in the killing range. However, the damage degree varies with the distance from the central point, in addition, different types of weapons and damaged buildings

PHP none?> What is the end mark?

I have a good explanation on segmentfault:If you use closed tags, any developer, user, or the spaces after inserting the closed tag in the FTP application may cause redundant output, PHP errors, and subsequent output failures or blank pages.

Example of php IP address regular expression judgment

The filter function filters IP addresses by using the following methods: The code is as follows:Copy code Echo filter_var ("127.0.0.1", "FILTER_VALIDATE_INT"); // return true or false Example.Determine whether the IP address is valid The code

PHP imports and exports excel using the PHPExcel class

Export classPHPExcel-type excel export, while some simplified PHPExcel processing, basically can meet the data export excel functionThe code is as follows: The code is as follows:Copy code // Load the PHPExcel classRequire './phpexcel/PHPExcel.

Detect mobile device php code (mobile phone access)

Php code The code is as follows:Copy code // Use the instanceInclude 'mobile _ Detect. Php ';$ Detect = new Mobile_Detect ();// Check for any mobile device.If ($ detect-> isMobile ())// Check for any tablet.If ($ detect-> isTablet ())// Check

Total Pages: 12780 1 .... 9403 9404 9405 9406 9407 .... 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.