SetSSI ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~Enable the settings file and search for the following text:## To use server-parsedHTMLfiles## AddType text/html. shtml# AddHandler server-parsed.
This is a PHP File Upload class with image display. In fact, it can be made into a function. But it is still a little fun to make it into a class .~~~~I should have used JS to verify the upload file type, but I am too lazy to do it. untitled
Note: The original name of this article is Creating a Multi-File Upload Script in PHP. I think this article is generally written, and the code is not very professional, but it is short, and I can't find a better article at a time, so I translated it.
PHP functions rand and mt_rand Mt_rand () is four times faster than rand () Many old libc random number generators have some uncertain and unknown features and are very slow. The rand () function of PHP uses the libc random number generator by
Use static to display the color of a table in different rowsWe use PHP to query data from the database and output the results to the browser. If there are many rows in the results and the bgcolor of the table is all monochrome, the browser will feel
Copy codeThe Code is as follows:Select FROM_UNIXTIME (pubtime, '% Y-% m') as pubtime, count (*) as cnt from articles group by FROM_UNIXTIME (pubtime,' % Y-% m ') PHP articles are archived by date (day) SQLCopy codeThe Code is as follows:Select
The previous article introduced how to use php-excel-reader to read excel files. As needed, convert data such as excel:
Create a database table as follows:
-- Database: 'alumni'
-- Table structure 'alumni'
Create table if not exists 'alumni '(
'Id'
When displaying database data, we usually use a loop body. The commonly used methods include the while () and for () statements, the following describes their usage in different situations.We will introduce the following:The while () statement can
Key points for implementing the Perpetual Calendar function using PHP:• Get the total number of days of the current month to be processed $ days• Get the number one of the months to be processed as the day of the week $ dayofweek$ Days: If you know
// GPC filter, automatically escape special characters in $ _ GET, $ _ POST, and $ _ cookies to prevent SQL injection attacks$ _ GET = saddslashes ($ _ GET );$ _ POST = saddslashes ($ _ POST );Copy codeThe Code is as follows:The following is an
There are two general processing methods: 1. Directly remove them through the JS editor. 2. After the application is submitted to the background, remove the invalid tag using the program. Next I will share a PHP processing method with a success rate
Copy codeThe Code is as follows:Class Timer {Private $ StartTime = 0; // the start time of the program.Private $ StopTime = 0; // end time of the program runningPrivate $ TimeSpent = 0; // time spent on running the programFunction start () {// start
The registration process goes through a single portal. The core judgment is checkip. You only need to make a game_id judgment in the template program without real-name authentication. Because I was too certain and eager to get off work, coupled with
Copy codeThe Code is as follows:// This method is purely a back-function and is not explained;Function countStr ($ str ){$ Str_array = str_split ($ str );$ Str_array = array_count_values ($ str_array );Arsort ($ str_array );Return $ str_array;}//
Remote Image Upload is very interesting. For example, if you copy a file from another website and the text contains an image, the editor automatically extracts the image and uploads it, in this way, you do not need to worry that the remote image
Simple factory mode:① Abstract base class: Class Defines abstract methods for implementation in sub-classes② Inherit from the subclass of the abstract base class: implement the abstract methods in the base class③ Factory class: Used to instantiate
So love micro-network now explains php built-in functionsCase-sensitive conversion functionsText html Tag processing functionCase-sensitive functionsCopy codeThe Code is as follows:Strtolower ()Strtoupper ()Ucfirst ()Ucword () String formatting
1. code optimizationCode optimization not only writes clean and clear code, but also simplifies the code. Zend Optimizer can be used to automatically complete these complex tasks. Zend Optimizer can be obtained from Zend Technologies's website http:/
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