Php converts a short address to a source address

HTTP/1.0 301 Moved Permanently [1] => Date: Mon, 04 Feb 2013 06:46:04 GMT [2] => Server: liteSpeed [3] => Connection: close [4] => X-Powered-By: PHP/5.3.20 [5] => Location: http://yxmhero1989.blog.163.com [6] => Content-Type: text/html [7] =>

Php web page capture news code

(. *) /"; $ ptr ="/ (. *) /"; preg_match_all ($ ptr, $ line, $ str, PREG_SET_ORDER); if ($ str) {$ res [$ c] = strip_tags ($ str [0] [2]); // $ res [$ c] [1] = $ url. "admin/view_n.php? Id = ". $ str [0] [1]; $ c = $ c + 1;} print_r ($ res [$ c]);}

PHP5 + APACHE2.2 Configuration

Due to version updates, these files have a new name: I use 5.4.Php. ini-production corresponds to php. ini-recommendedPhp. ini-development corresponds to php. ini-distThe other steps are the same. You still need to modify the configuration file,

PHP Regular Expression replacement preg_replace

There is a problem: how to replace a specific string in a string. For example, replace abc in the string Abc fdab ertDe fda abc fdd, where abc is case-insensitive and the string after replacement is fdab ertDe fda fdd. At that time, we immediately

Php. htaccess pseudo-static

Print? ## The following are website pseudo-static Regular Expressions#RewriteEngine OnRewriteRule into index.html $ index. phpRewriteRule extends about.html $ about. phpRewriteRule maid? Id = $1RewriteRule implements contact.html $ contact.

Php: Incorrect current time obtained using the date function

PHP is a beginner who wants to obtain the current time on the page. Anyone who has learned programming knows to use the time function date () to format a local time/date with this function, write a test code first. The result output time is eight

Recursive Algorithm example

1. Example (described in C ++ ): Row number Program 0 p (int w) 1 {if (w> o) 2 {cout 3 p (W-1 ); 4 p (W-1 ); 5} 6} End   Print the result after executing statement p (4): 4 3 2 1 1 2 1 1 3 2 1 2 2 2 1 1   Ii. Description: 1. recursive calls share

Common php Regular Expression matching

[Php] Function pregPN ($ test ){/**Matching mobile phone numberRules:Basic mobile phone number format:The first three are:Mobile: 134-139 147 150-152 157-159 182 187China Unicom: 130-132 155-156 185 186China Telecom: 133 153 180 189The last eight

Implementation of ThinkPHP Paging

The paging class needs to be combined with the query. We can use the limit method or page method that comes with ThinkPHP, the purpose is to obtain the data on the current page (you can also obtain the complete data first and then display the data

Php practice 16th days

The following figure shows the front-end and back-end. The front-end uses the template of last Friday. The back-end is hand-written.   Today I learned When the css overflow settings are out of the range, you can give the scroll bar or hide the

Install php extension module phpize

Install php extension module phpize One way to install the PHP module is to add relevant parameters to recompile PHPOne is to use phpize, such as eaccelerator and memcache, which is convenient and can be enabled or disabled at any time without

Build a PHP Environment

Build a PHP Environment 1. First install phpStudy2013.exe After installing the program integration package, you must manually set the port to be occupied.  Default username root Password root Ii. Build the thinkphp framework Go to the

Fast sorting and Bubble Sorting in php

Fast sorting Function quicksort ($ str ){If (count ($ str) $ Key = $ str [0]; // obtain a value for comparison later;$ Left_arr = array ();$ Right_arr = array ();For ($ I = 1; $ I If ($ str [$ I] $ Left_arr [] = $ str [$ I];Else$ Right_arr [] = $

Use System constants in the thinkphp template to obtain the ip address

{$ Think. server. SERVER_ADDR} {$ Think. server. REMOTE_ADDR} {$ Think. server. SERVER_NAME} {$ Think. const. _ SELF __} {$ Think. const. APP_NAME} {$ Think. now} {$ Think. template} {$ Think. version} {$ Think. LDELIM}

Php trainer in the Fibonacci series

The number of columns starts from the third and each item is equal to the sum of the first two items. F0 = 0, F1 = 1, Fn = F (n-1) + F (n-2) Recursive version and non-recursive version.   php function fib($n){ $array = array(); $array[0] = 1;

PHP Class Attribute Class static variable access

Php has two types of class attributes: Class constants and class static variables. These two types are easy to cause confusion. Like static class methods and class instance methods, static class attributes and instance attributes cannot be redefined

Bubble Algorithm for sorting algorithms

The bubble algorithm is a simple sorting algorithm. It repeatedly visits the series to be sorted, compares two elements at a time, and exchanges them if their order is wrong. The work of visiting a sequence is repeated until there is no need for

[PHP] How to Use Mobile_Detect to determine the devices accessing the Website: Android, tablet, and computer

Mobile_Detect is a lightweight open-source mobile device (mobile phone) detection PHP Class, It uses a string in the User-Agent and HTTP Header to detect the mobile device environment. The most powerful part of the PHP class library detected by

Functions of the php-GD library (1)

240 [1] => 124 [2] => 1 [3] => width = "240" height = "124" [bits] => 8 [channels] => 3 [mime] => image/gif) // image_type_to_mime_type-obtains the MIME type of the image type returned by getimagesize, exif_read_data, exif_thumbnail, and

Obtain the content links of all topics on the phpcms website.

'; $ SQL = '(select title, url from v9_news where catid = '. $ catrow ["catid"]. 'order by id desc) UNION (select title, url from v9_product where catid = '. $ Catrow ["catid"]. 'order by id desc) '; $ result = mysql_query ($ SQL); while ($ row =

Total Pages: 12780 1 .... 10119 10120 10121 10122 10123 .... 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.