PHP mobile phone number in the middle four digits with an asterisk * instead of display

Using PHP in three simple ways to achieve the mobile phone number of the middle four (n-bit) with an asterisk display: $mobile = ' 13912345678 ';1. String interception method$newMobile 1 = substr ($mobile, 0, 5). ' '. substr ($mobile, 9);echo

PHP Class Const Constant Access Method Example

Example. Const constant Access The code is as follows Copy Code Class Math {Const num=3.14;Public Function Shownum () {return self::num;}}echo Math::num. " ";$math =new Math ();echo $math->shownum ();Results:3.143.14

PHP For Loop Learning notes 99 multiplication table

For statementYou can use a For statement if you have determined how many times the code block has been repeatedly executed. Grammar Php The code is as follows Copy Code for (initialization; condition; increment){code

Learning notes for the PHP Observer observer model

So how do you let computers know that their allies are being attacked? and respond automatically? The problem to be solved: Once a computer is attacked by us, other computers will be informed and automatically send troops to help. Train of thought:

PHP Gets the remote picture and saves it to the local

Example 1 The code is as follows Copy Code /** Function: PHP a variety of ways to achieve the perfect download remote pictures saved to local* Parameters: File URL, save file name, use the download method* Use the

PHP error_reporting (e_all ^ e_notice) Error Report detailed description

An example is provided:In the Windows environment: Originally in the php4.3.0 of the program, in the 4.3.1 Why many errors, the general hint is: notice:undefined varialbe: variable name. For example, code that resembles the following:

PHP Perfect RSS-generation class

The code is as follows Copy Code Include_once ("class/rss.class.php");//Introduction of RSS PHP class$RSS = new RSS ("Name", "Address", "description", "RSS channel icon");$RSS->additem ("title of the Log", "Address of the log",

Large Capacity PHP free space

pages.at established stable 25M free PHP spaceSupport FTP upload and management files; Support PHP4, but do not provide MySQL database, this site has been introduced several dedicated to provide a free MySQL database, such as Freemysql; Free 1

PHP detects the length and width of uploaded images

/*Array getimagesize (string $filename [, Array & $imageinfo]) The getimagesize () function determines any given image size of the file and returns the size of the text string with the file type and height/width used in a normal HTML img tag and

PHP Online Questionnaire Survey program A

Also used yesterday to a PHP online questionnaire survey program Oh, customers want to advertise in Sina, so to count the user related information, okay, let's look at the effect page first Questionnaire Survey 1, Luzhou old cellar tequ How many

PHP read Alexa information

function Alexa ($domain){$alexa = ';$content = get_content (' http://www.alexa.com/data/details/traffic_details?url= '. $domain);if (Preg_match ()/3 mos. Change ([ss]*?) /", $content, $matches)){$change = Strpos ($matches [1], ' down_arrow.gif ')? '

PHP Replace empty line mismatch empty line problem solution

A blank line, which may include, line breaks,  , and spaces. When processing a string, it is unavoidable to encounter a blank line processing.1, replace blank lines, blank lines can include spaces, ,\t,\f,\n $s = preg_replace ('/(^ (\s|) *$)/M '

Summary of php string segmentation functions

The basic syntax of the PHP function split () isArray split (string $ pattern, string $ string [, int $ limit]).Example The code is as follows:Copy code List ($ user, $ pass, $ uid, $ gid, $ extra) = split (":", $ passwd_line, 5 );?> Parsing

Php glob implements directory file traversal and searches for file paths matching the pattern

I. Function prototypeArray glob (string pattern [, int flags])Note: The glob () function returns an array containing matching files/directories. If an error occurs, FALSE is returned.2. Version compatibilityPHP 4> = 4.3.0, PHP 5III. Basic functions

Important functions of $ _ FILES file upload in php

$ _ Files ["file"] ["name"]-name of the uploaded file$ _ Files ["file"] ["type"]-type of the file to be uploaded$ _ Files ["file"] ["size"]-size of the uploaded file, in bytes$ _ Files ["file"] ["tmp_name"]-name of the temporary copy of the file

Solution to Memcached connection timeout in php

During a routine check log, we found that a large number of PHP connection Memcached timeout errors were found in the Nginx log, as shown below:PHP Warning: Memcache: connect (): Can't connect to 127.0.0.1: 11211, Connection timed out (110)

Advantages and disadvantages of three PHP configuration methods supported by IIS6.0

ini

In Windows IIS 6.0, PHP is usually configured in CGI, ISAPI, and FastCGI. These three modes can be successfully run in IIS 6.0, the following describes the differences in configuration and performance of the three methods.1. CGI(Common Gateway

PHP Chinese character verification code

Replace hb. ttf with the ttf you just downloaded.Header ("Content-type: image/PNG ");$ Str = "first, when there is a conflict with everyone, the main person will use work hours for them to make Chinese products. When I arrive, he will make

Implementation of count multi-dimensional array length statistics in php

The program running result below is () The code is as follows:Copy code ? $ Numb = array (Array (10, 15, 30), array (10, 15, 30), array (10, 15, 30));  Echo count ($ numb, 1 );A.3B .12C.6D.9 Answer: BIf the mode in the count function is set to

Why sometimes PHP programs display X-Powered-By PH at the beginning?

This is because of PHP. Some settings in INI are incorrect. The most likely reason is that there are invalid DLL files. But why?I created an empty test. Php file under WIN32.Then execute c: php4php.exe test. php. At this time, my php. ini

Total Pages: 12780 1 .... 3266 3267 3268 3269 3270 .... 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.