Code generated for a php short URL (similar to Weibo short URL)

Share the code generated for a php short URL.Copy codeThe Code is as follows: urlShort Header ("Content-Type: text/html; charset = UTF-8 ");Function base62 ($ x ){$ Show = '';While ($ x> 0 ){$ S = $ x % 62;If ($ s> 35 ){$ S = chr ($ s + 61 );} Else

How to generate a random number in the smarty Template

What should I do if I want to generate a random number in the smarty template? Generate in the PHP file and assign values to the template. This is absolutely feasible, but it is too complicated. The following tips will be used to generate random

PHP retrieves the date list for the first 30 days of the current date

Recently, the project requires a statistical function to count the records of the first 30 days before the current date. The function is quite simple. I will share with you the implementation method below to make it easy for anyone who needs it. In

Use PHP to create a static website template framework

The template can improve the website structure. This article describes how to use a new function and template class of PHP4 to control the page layout in a website composed of a large number of static HTML pages. Outline: = The template can improve

Regular Expression Syntax example

Here are some examples of possible regular expressions:/^ \ [\ t] * $/"^ \ [\ t] * $" matches a vacant row. /\ D {2}-\ d {5}/"\ d {2}-\ d {5}" verify that an ID number consists of two characters, A hyphen and a five-digit combination. /(. *). * \/\ 1

Tip: PHP titles about Chinese character exchange and pattern matching

In the past two days, I am working on a program to highlight key words. The program I have written has been well tested locally, but a pile of garbled code is displayed on the page, let alone highlight it. you just don't have to watch it! I am

Analysis of PHP configuration file php. ini

Today, let's talk about some interesting content in the PHP. ini file. The PHP. ini file is trusted by every PHP enthusiast. It is named PHP3.INI in the previous PHP version PHP3.0. Open it with NOTEPAD. files are usually used to control the Win of

Examples of special effects in PHP programs using practical code

Blocking class 1. disable right-click bodyoncontextmenu = return (false) 2. disable bodyonselectstart = "returnfalse" 3. disable bodyonpaste = "returnfalse" 4. direct access to [within the framework is prohibited] scriptif (top = s Block prohibited 1

Use regular expressions in php

Regular expressions are important in all programming languages. php also provides regular expressions that can be used to search for and replace strings, basically, we can use java regular expressions on php. Regular Expressions 1. Common regular

6 Methods for PHP to obtain the file extension

Yesterday, I talked to a friend in a PHP chat group (276167802, verification: csl, if you are interested, you can join in and discuss it) and mentioned six methods for PHP to get the file extension, now let's share with you: 1. string search and

Php extension and embedding-array and Hash Table 2 in php extension

Next, let's talk about the APIs of arrays and hash tables in the php extension. this section mainly describes the sorting, comparison, and pole & amp; 20540 of callback traversal functions; the IterationbyhashApply function is used to traverse the

Magic in PHP: __construct ,__ destruct ,__ call ,__ callStatic ,__ get ,__ set ,__ isset ,__ unset ,__ sleep,

1. The _ get and _ set methods are designed for attributes that are not declared in the class and their parent class: __get ($ property) this method is called when an undefined property is called; __ set ($ property, $ value) assigns & amp; 20540 to

PHP Pl operating XML with DOMXML [summary]

1. preface the XML tree structure is clear and suitable for configuration files. In PHP, DOMXML can be used to operate XML. This article summarizes how PHP creates, adds, and queries XML files using DOMXML. 2. the nodes in DOMXMLXML are divided into

Use HTML forms in combination with PHP (2)

It is convenient to use the representation in listing 2 in combination with PHP in HTML form (2), but it is only available when the PHP pseudo command register_globals is set to on. The representation in version list 2 is of course convenient, but

Use Socket to send emails in PHP (3)

Use a Socket in PHP to send an email (3) The following is a real secret. you should check it carefully. :) --------------- mail sending and processing The following are the real secrets. you should check them carefully. :) -----------------------

Solution for sharing sessions among multiple Web servers

Many titles that are reserved for user Session verification during development are interesting and summarize several plans for reference only. [Title proposal] in order to meet the needs of large enough customers, we set up N Web servers Many titles

How to compare dates and display 10 days in 5 days

The important argument is that it is concentrated on SELECTsomethingFROMtableWHERETO_DAYS (NOW ()-TO_DAYS (date_col) = 5; I tried it for a long time, but the results still failed. today I read MYSQL functions, finally, I came up with the results and

Use PHP to implement the login verification code function

Use PHP to implement the login verification code :? Phpsession_start (); session_register ("login_check_number"); // the result of the verification code on the chianren last night is considered, using the GD library of PHP to complete similar

PHP development course object-oriented | PHP development course

PHP is the scripting language for weak variables, which means you do not need to define them first. It can also give a lot of freedom, but for programs, freedom is not a good thing. It brings a lot of trouble to protect staff browsing in the future.

Common headers in XML (1)

What is the general title of XML? Extensible Markup Language (XML) is a common data language on the Web. It enables developers to transfer structured data from many different exploitation programs to the desktop for local computing and demonstration.

Total Pages: 12780 1 .... 2287 2288 2289 2290 2291 .... 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.