Source: http://www.crazyphper.com
/**
* Change the date format to a different display style according to the following rules
* Less than 1 minutes shows how many seconds ago
* Less than 1 hours, show how many minutes ago
PHP code to get yesterday with tomorrow's date, there is a need for friends, can refer to the next.Example code:
"; echo "Yesterday:". Date ("Y-m-d", Strtotime ("-1 Day")), ""; echo "Tomorrow:". Date ("Y-m-d", Strtotime ("+1 Day")). ""
For everyone to introduce a copy CodeIgniter FTP class, the function is very powerful, have the need of friends, you can refer to the next.1, File Upload class ftp.php
', ' username ' + ', ' password ' + ', ' port ' = ' ... '; */Public
Class myclass{
Public $prop = 123;
}
$obj = new Myclass ();
?>
Copy CodeThe member property of a class (the salutation of a property is relative to the "method") includes class constants and class
Include ("./class/class.php"); Basic header file containing class
Include ("./class/phpexcel/phpexcel.php"); Generate basic class definitions for Excel (note the case of file names)
If you are outputting an Excel file directly, include
Create function with an exception
function Checknum ($number)
{
if ($number >1)
{
throw new Exception ("Value must be 1 or below");
}
return true;
}
Trigger exception
To turn numbers into Chinese charactersWrote one of his own
function Number2chinese ($num, $m = 1) {
Switch ($m) {
Case 0:
$CNum = Array (
Array (' 0 ', ' one ', ' II ', ' three ', ' establishments ', ' Wu ', ' Lu ', '
This section is about the practice of PHP arrays, using a one-dimensional array averaging example, for everyone to learn the reference. Requirements: Enter 5 numbers in the input box (enter those 5 numbers separated by a space), use a
This article describes the PHP development of the Web site how to deal with large traffic and high concurrency problems, the need for friends to refer to it.How does a PHP website handle high traffic and concurrency?First, verify that the server
if (Isset ($_request[' GLOBALS ')) OR isset ($_files[' GLOBALS '])) {
Exit (' Request tainting attempted. ');
}
Copy CodeRegister_globals is a control option in PHP that can be set to off or on, default to OFF, to decide
This article describes, The PHP code used to get the file name extension, which gets the extension in PHP, is convenient to use the PathInfo () method. Refer to a friend who needs it. In PHP, it is easy to get the file extension from the end of the
This article introduces, using PHP to record search engine keywords a piece of code, as a beginner's reference, or good.Using PHP to record search engine search keywords, the code is as follows:
' word ', ' google.com ' = ' Q ', ' sina.com.cn '
#yum-y install MySQL mysql-server mysql-devel
Copy CodeConfigure MySQL Boot service
#chkconfig--add mysqld (add MySQL service to the service list)
#chkconfig mysqld on (set up MySQL service with boot)
This article describes the use of the PHP output cache, in PHP's so-called output cache, that is, the echo or other output commands in the code are written to PHP buffer at execution time, after the script executes or enforces the output cache
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