Common form verification classes. With this, General verification is complete.

Copy codeThe Code is as follows: /*** Page function: common form verification classes* Author: Happy with the wind* Creation Time: 2006-3-6* QQ: 276624915*/Class class_post{// Verify whether it is a combination of letters and numbers with a

A PHP calendar Program

// If ($ HTTP_GET_VARS [year] = ""){$ HTTP_GET_VARS [year] = date ("Y ");}If ($ HTTP_GET_VARS [month] = ""){$ HTTP_GET_VARS [month] = date ("n ");}$ Month = $ HTTP_GET_VARS [month];$ Year = $ HTTP_GET_VARS [year];// If ($ year {Echo "error! ";Echo "

Use regular expressions compatible with Perl in PHP

Preface PHP is widely used in Web Background CGI development. It usually produces some results after user data. However, if the user input data is incorrect, a problem may occur, for example, a person's birthday is "August February 30 "! How can we

PHP beginners (9)

Build a simple interaction website (5)8. Voting SystemIn many cases, we need to collect opinions from Internet users and netizens. For example, comparison between the new page and the old page, views on a specific event, and predictions on the

PHP beginners (8)

7. File UploadYou can use PHP to upload files. Note that the browser on the client should be Netscape3 or later or IE3. At the same time, because this program is related to your PHP configuration file (PHP3 is php3.ini and PHP4 is php. in) settings.

Shield robots from searching php code for email addresses from your website

Spam is annoying. The following is a method that can automatically shield robots from collecting email addresses from your website.Copy codeThe Code is as follows:Function security_remove_emails ($ content ){$ Pattern = '/([a-zA-Z0-9. _ % +-] + @ [a-

Introduction to PHP Chinese Word Segmentation automatic keyword acquisition

Copy codeThe Code is as follows:Header ("Content-Type: text/html; charset = UTF-8 ");Define ('app _ root', str_replace ('\', '/', dirname (_ FILE __)));$ Test = 'Here is a Chinese test code! ';Function get_tags_arr ($ title){Require (APP_ROOT.

Comparison of PHP and MYSQL date

MYSQL date comparisonTO_DAYS (NOW ()-TO_DAYS (date_col) Our date_col must be in the date and time format, not the timestamp,Mysql> SELECT FROM_UNIXTIME (875996580 );-> '2017-10-04 22:23:00'Day (FROM_UNIXTIME (1277709862) returns the number of days

My group email program

UNTITLED Include "connect. inc. php ";If ($ subject ){$ Query = "select name, email from user ";$ Res = mysql_query ($ query );$ Row = mysql_fetch_array ($ res );While ($ row ){Mail ($ row ['email '], $ subject, $ row ['name']. ": n". $ text. "n

Php variable range

For example:Copy codeThe Code is as follows:$ A = 1;Include 'B. inc ';?> The variable $ a will take effect in the included file B. inc. However, in user-defined functions, a local function range will be introduced. By default, any variable used in a

Php simulates the function code of the js function unescape.

Copy codeThe Code is as follows:Function unescape ($ str){$ Ret = '';$ Len = strlen ($ str );For ($ I = 0; $ I {If ($ str [$ I] = '%' & $ str [$ I + 1] = 'U '){$ Val = hexdec (substr ($ str, $ I + 2, 4 ));If ($ val Else if ($ val 6). chr (0x80 | ($

Migrate from C/C ++ to PHP -- a function that determines the character type

In C/C ++, the header file ctype. h defines a set of macros for the character type to obtain the type of the given character.PHP does not have related functions. The other day I found that an extension library named php_ctype.dll was provided in PHP

PHP dataset construction of JSON format and new array method

You have written a PHP result set to convert it to a function in JSON format. You can directly call:Copy codeThe Code is as follows:Function RecordToJson ($ recordset){$ Jstr = '[';While ($ rs = $ recordset-> Fetch ()){// $ Nick = iconv ("GBK", 'utf-

Use ODBC pagination

$ Pagesize = 3; // you can specify the number of entries displayed on each page.// Calculate the total number of records$ Rs_num = "select count (*) as id from table ";$ Rs_num = odbc_exec ($ conn_id, $ rs_num );$ Rs_num = odbc_result ($ rs_num, "id

Introduction to the memory management function memory_get_usage () in PHP

The following is an example of PHP memory_get_usage:Copy codeThe Code is as follows:Echo memory_get_usage (), ''; // 143952$ Tmp = str_repeat ('HTTP: // blog.micxp.com/', 4000 );Echo memory_get_usage (), ''; // 232048Unset ($ tmp );Echo

Php implementation of quick sorting Function Code

Code 1:Copy codeThe Code is as follows: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];

Session function of php4 (III)

The general feeling is that the session function of php can still be used, which is quite convenient and saves a lot of processing.Cookie troubles. Php session management is based on files. The default value is in the/tmp directory.Generate a

In php, select echo or dump Based on the variable type.

In this case, the is_scalar built-in function is used.Is_scalar -- checks whether the variable is a scalar.Scalar variables refer to variables that contain integer, float, string, or boolean, while array, object, and resource are not scalar

Php code for mailbox collection (capture the email address on the webpage)

Copy codeThe Code is as follows:$ Url = 'HTTP: // www.jb51.net'; // This webpage absolutely contains an email address.$ Content = file_get_contents ($ url );// Echo $ content;Function getEmail ($ str ){// $ Pattern = "/([a-z0-9] * [-_ \.]? [A-z0-9] +

PHP miscellaneous reconstruction-improving the design of existing code-2 moving between objects

Mind Map Index:Ø Move Method (shift function) Ø Move Field (shift value Field) Ø Extract Class (Extract Class) Ø Inline Class (concatenate Class, is to merge the current class to other classes.) Ø Hide Delegate (hiding the Delegate relationship) Ø

Total Pages: 12780 1 .... 12333 12334 12335 12336 12337 .... 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.