Using PHP code to realize automatic judgment turning of Web page

User-acceptable language information, placed in $_server[' http_accept_language ', variable information is similar to "ZH-CN", if it is a multilingual column, is similar to "zh-cn,en;q=0.8,ko;q=0.5,zh-tw;q= 0.3 "The following questions can be solved.

PHP to automatically save pictures when publishing articles

$img _array = Array (); $content 1 = stripslashes ($content 1); if (GET_MAGIC_QUOTES_GPC ()) $content 1 = stripslashes ($content 1); echo $content 1; Preg_match_all ("/(SRC│SRC) =" (http://(.). (gif│jpg│jpeg│bmp│png)) /isu ", $content 1, $img _array)

Commonly used date processing functions in PHP

DATE_FORMAT2 ($rs [' Time '], '%y year%m month%d days%h%m minute%s seconds ');function Date_format2 ($string, $format = '%b%e,%y ', $default _date=null){if (substr (php tutorial _os,0,3) = = ' win ') {$_win_from = Array ('%e ', '%t ', '%d

PHP Jquery.ajax No Refresh login Simple instance Code

A very simple application example, the use of Jquery.ajax to achieve no refresh login effect, convenient very simple, the example also only said the jquery application of this masonry, PHP tutorial that paragraph did not say, there is a need for

PHP regular Chinese multiple authentication methods

PHP Tutorial Regular Chinese multiple verification methods gb2312 Chinese character alphanumeric underline regular expression Preg_match ("/^[". Chr (0XA1). " -". Chr (0xff)." a-za-z0-9_]+$/", $STR); Look at one more example of judgment

PHP multidimensional array sorting and Operation function

PHP tutorials Multidimensional array sorting and Operation functionsfunction ARRAYCD ($arr) {Static $res _arr=array ();if (Is_array ($arr)){foreach ($arr as $key => $val){if (Is_array ($val)){ARRAYCD ($val);}else{$res _arr[]= $val;}}}elseif

Phone number matching for PHP regular expression

Preg_match_all ("/(?)  (D{3})?  )?  -? (? (1) [-S]) d{3}-d{4}/x ","Call 555-1212 or (221)-(820) -555-1212", $phones);Print_r ($phones [0]); echo "";Print_r ($phones [1]); The results of the output are:Array ([0] => 555-1212 [1] =>

PHP Chinese processing skills

chr

function Unicode_urldecode ($url){Preg_match_all ('/%u ([: Alnum:]]{4})/', $url, $a);foreach ($a [1] as $uniord){$dec = Hexdec ($uniord);$utf = ';if ($dec {$utf = Chr ($DEC);}else if ($dec {$utf = Chr (($dec-($dec% 64))/64);$utf. = chr (128 + ($dec%

PHP-> and => differences and examples Tutorial

The simple thing is,-> the member of the calling object=> Specify subscript Here are a few examples of-> and => code that give you a clearer idea of what usage and functionality are and what the difference is.*/=> usage, available to array arrays,

PHP file_put_contents function

The file_put_contents () function writes a string to the file and calls fopen (), fwrite (), and fclose () in turn.DescriptionParameter data can be an array (but not a multidimensional array).From PHP 5.1.0, the data parameter can also be specified

PHP Mailbox Regular Expression

? if ($_post){if (Funcemail ($_post[' url ')){Echo ' Valid email address ';}Else (Funccard ($_post[' url ')){Exit (' Please enter the correct email address ');}} ?> "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >php-Mailbox Regular

PHP judgment number or identity card regular expression

?function Funcnum ($str, $num 1= ", $num 2 =")//number Regular expression test{if ($num 1!= ' and $num 2!= ') {Return (Preg_match ("/^[0-9] {". $num 1.", ". $num 2."} $/", $str))? True:false;}else{Return (Preg_match ("/^[0-9]/", $str))? True:false;

PHP zip code Regular expression

? if ($_post){if (funczip ($_post[' url ')){Echo ' valid zip ';}Else (Funccard ($_post[' url ')){Exit (' Please enter the correct postcode address ');}} ?> "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >php Postcode Regular

PHP and Access database Connection instance

echo "";echo "";echo "personID";echo "FirstName";echo "LastName";echo "Age";echo "";$connstr = "Driver=microsoft Access DRIVER (*.mdb);D bq=". Realpath ("Spiderresult.mdb");$conn =odbc_connect ($connstr, "", "", SQL_CUR_USE_ODBC);$query =odbc_do

How PHP checks whether a library or function is available

Get all the available modules-get_loaded_extensionsThis function returns all the (available) modules that have been loaded. Usage: Print_r (Get_loaded_extensions ()); 2. Get the available functions for the specified module-get_extension_funcsThis

Webmaster Tools-php Soso Included page number query procedure

For ($i =0 $i $pagecode = @file_get_contents ("Http://www.soso.com/q?w=site:". $q);if ($pagecode) {Break}}Echo $pagecode;if ($pagecode) {Preg_match ('/Search to about (. *?) Results/', $pagecode, $sosos);if ($sosos [1]) {$sitesoso = $sosos [1];}else{

Latest php 150M free space

You do not need to register a free file upload space for a foreign file that can be directly uploaded. The maximum size of a single file is 100 MB. You can upload multiple documents at a time. After the upload is successful, a download and sharing

Free php space + database

Free PHP space 10 M500 filesThe traffic is 500 mb/month.Log on to the home page at least once in three months.The size of a single file is unlimited.Advertisement availableFTP quick UploadApplication URL: http://www.512j.com/Longs note: it is a

Introduction to parse_url () function usage in php

A useful function in PHP, parse_url, is particularly convenient for information capture analysis. For example: The code is as follows:Copy code $ Url = "http://www.111cn.net/aaaa/"; $ parts = parse_url ($ url );Output:Array([Scheme] => http[Host]

Php process control statement

  The code is as follows:Copy code Switch (variable ){Case value1:Statement1;Break;Case value2:...Default:Defulat statement;} The switch statement is compared with the value in case based on the value of variable. If the value is not equal,

Total Pages: 12780 1 .... 12242 12243 12244 12245 12246 .... 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.