PHP common Form Validation Regular expression _ regular expression

chr

function Is_email ($STR) { Check Email Return Preg_match ("/^\w+ [-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$/", $str); } function Is_url ($STR) { Check the Web site Return Preg_match ("/^http:\/\/[a-za-z0-9]+\.[ a-za-z0-9]+[\/=\?%\ -&_~ ' @[\]\

PHP Regular Expression Learning notes _ regular expressions

Copy Code code as follows: Match the text, this is occasionally easy to use, but be careful that the character contains \e $str = ' [A-z] '; $str = preg_replace ('/\g[a-z]\e/', ', ', $str); Echo $str; Print empty, all replaced,

PHP integrates with existing Java Applications _php Foundation

Another advantage of PHP functionality is its ability to invoke existing Java object methods. This feature allows you to integrate PHP into existing java-based applications. This feature is especially fashionable if you are promoting PHP in your

Solution to path problem in PHP _php Foundation

Solution to path problem in PHP Introduction: The inclusion path in Perl and PHP has always been a difficult problem, mainly related to the operating system and Web servers, and it is impossible to be very intelligent to solve this path problem. The

How to use PHP to get the _php foundation of files on the network

Set up the files we are going to use $srcurl = "http://localhost/index.php"; $tempfilename = "tempindex.html"; $targetfilename = "index.html"; ?> Generating generating ... First delete the temporary files that might be left over from the last

PHP object-oriented Strategy (iii) Special reference to the use of "$this" _php Foundation

7. Use of special references to "$this" Now we know how to access members of an object, accessed through "Object-> members," in the The outside of the image to access the form of the members of the object, then if I want to inside the object, let

PHP Auth_http class library for identity Parity _php Foundation

Copy Code code as follows: Require_once ("auth/http.php"); Setting connection options for a database $auth _options=array ( ' DSN ' => ' mysql://root:1981427@localhost/test ',//database connection string ' Table ' => ' tablename1 ',//list

Feel free to paste your own pictures with text PHP watermark _php Tips

Always add text to the picture you're pasting ? Header ("Content-type:image/jpeg"); function Makethumb ($srcFile, $text, $size =12, $R =0, $G =0, $B =0) { if (! $text) { $text = ' welcome xs.net.ru Xayle '; $size = 20; $R = 255; } $data =

PHP progress bar Implementation Code _php Foundation

Copy Code code as follows: 0% Flush (); For ($i =0 $i { $width = $i * 4; echo ""; For ($j =0 $j { To demonstrate the effect of the progress bar, an empty loop is executed here } Flush (); } ?>

PHP Form Verification Implementation Code _php Foundation

Copy Code code as follows: Form name: Password: Password confirmation: Sex: male Women Birthday: E-mail: Career: Copy Code code as

PHP Filter Dangerous HTML code _php base

The following is the program code: Copy Code code as follows: function uhtml ($STR) { $farr = Array ( "/\s+/",//filter Excess blank Filtering etc. may introduce malicious content or maliciously change the display layout of the code, if

Introduction to PHP Learning several good examples of Code _php Foundation

1,php Connection Database $dbhost = ' localhost '; $dbuser = ' root '; Your MySQL username $dbpass = ' 123456 '; your MySQL password. $dbname = ' data '; The name of your MySQL library Connecting to a local database $GLOBALS ["conn"] =

Personal Webmaster system to do Web pages commonly used PHP code _php skills

Copy Code code as follows: $str = File ("http://tq.tom.com/china/index.html"); $count = count ($STR); for ($i =0; $i $file. = $str [$i]; } $TOMTQ = Explode ("", $ file); $TOMTQ = Explode ("", $TOMTQ [1]); $TOMTQ = $TOMTQ [0]; $

PHP Simple encapsulation of some common JS operation _php Skills

In the Web programming, we should often use some common JS operations, such as alert (), usually encountered again write, inspired by the company, I wrote a simple class to automatically generate these JS, the purpose is to facilitate, a gadget,

A method of gzip compression in PHP HTTP mode lifting the _php technique

GZIP compression transmission can more effectively save bandwidth flow. He first compresses the text into. GZ and then transmits it to the browser, which is finally extracted by the browser for presentation to the user. Older browsers may not

PHP program _php techniques for moving data into DEDECMS

PS: This can be extrapolate, such as new cloud or NB and other ASP article system can be converted into dedecms or other PHP cms Copy Code code as follows: Reading MDB database routines Set_time_limit (0); $conn = new COM ("ADODB.

Verify the coordinates in a certain coordinate region PHP code _php Tips

Previously encountered such a demand, to the company's services in the map display, and the user's daily access to the coordinates of statistics to see how many users in the range of services can be reached within the radius. The following is the

!_php techniques for Chinese string interception functions in PHP that support multiple encodings

supports a variety of encoded Chinese string interception functions! Copy Code code as follows: /* * @todo Chinese interception, support Gb2312,gbk,utf-8,big5 * * @param string $str to intercept * @param int $start intercept start

Code _php tips for generating HTML paging lists in PHP

$db = mysql_connect ("127.0.0.1", "root", "*******") or Die ("cant ' t connect host"); $re = mysql_select_db ("T", $db) or Die ("can ' t Open database"); $sql = "SELECT * FROM News"; $res = mysql_query ($sql); $row = mysql_num_rows

Share a nice PHP verification code class _php tips

This example for you to share a beautiful PHP code class for your reference, the specific content as follows Authentication code class Validatecode {Private $charset = ' abcdefghkmnprstuvwxyzABCDEFGHKMNPRSTUVWXYZ23456789 ';//random factor

Total Pages: 12780 1 .... 9358 9359 9360 9361 9362 .... 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.