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

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-

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

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

A serach database program written using mysql_odbc and php

query condition query condition User name: User address: User's phone number: // Backend PHPEcho " ";Echo "query result :";Echo"";Echo"";$ Conn = odbc_connect ("blue", "root ","");$ Name. = "% ";$ Add. = "% ";$ Tel. = "% ";$ Query = "select

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

A ubbcode function is fast.

Someone posted aboveHowever, the speed is slow and long.Here isFunction ubb ($ str ){$ Color = Array ('red', 'blue', 'green ');$ Str = eregi_replace ('\ [url \] ([a-zA-Z0-9 @: % _.~ #-\? &] +) \ [\/Url \] ',' \ 1 ', $ str ); // url$ Str =

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

Function usage of php Learning

1. Declare a function In PHP, the methods for defining functions are almost the same as those in other programming languages. below is the syntax structure of PHP declarative functions:Copy codeThe Code is as follows:Function function_name ($

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 abstract class Introduction

In natural language, we understand the abstract concept that a large description of an object is a common feature for a certain type of object. The same is true in PHP. we abstract a class to specify the general behavior of the class. This class

PHP sprintf () function application (Definition and usage)

Syntax sprintf(format,arg1,arg2,arg++) Parameters Description Format Required. Conversion format. Arg1 Required. Specifies the parameter inserted at the first % symbol in the format string. Arg2

A black humorous Analysis of Timestamp obtained using mktime in PHP

The following code is a timestamp provided by most people on the Internet. At first glance, it can only be said that the current date is obtained, rather than the timestamp. Do not explain it more!Copy codeThe Code is as follows:$ Now = mktime (0, 0,

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) Ø

PHP section 2 data type conversion

In the following cases, the variable is considered to beNULL: AssignedNULL. Not assigned. QuiltUnset (). NULLThe type has only one value, which is a case-insensitive keyword.NULL(You can write NULL or null ). Convert a variableNullType will

PHP design mode registry mode

The following is the code of the basic registry class:Copy codeThe Code is as follows:Class Registry {Private static $ instance;Private $ request; // registry content classPrivate function _ construct () {}// this class cannot be instantiatedStatic

Php code for retrieving Baidu's popular word data

Copy codeThe Code is as follows:/*** Get Baidu's buzzwords* @ User Xiaojie* @ From http://www.isharey.com /? P = 354* @ Return array returns Baidu's buzzword data (array return)*/Function getBaiduHotKeyWord (){$ TemplateRss = file_get_contents

Total Pages: 12780 1 .... 12033 12034 12035 12036 12037 .... 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.