The general language function must be defined as running, while PHP supports the dynamic creation of functions at run time, here is a simple example of creating a function $ A with different conditions when moving
if (count
!--? php
//Notice that the include classpath is correct
require_once (d Irname (__file__). '/export.php ');
$exceler = Newjason_excel_export ();
//Generate Excel format here different formats are
This code can help you determine the main color of any image , a simple statistical algorithm is used to implement
$i = imagecreatefromjpeg ("image.jpg");
for ($x =0; $x
for ($y =0; $y
$
The Strpos () function can be used to find substrings in PHP. The Strpos () function will attempt to find the location where the substring first appears in the source string. If found, it returns a non-negative integer indicating where the substring
Encode64 can obtain the shortest 26 English-size alphanumeric plus "-_" two symbols encoded data, the string can be transmitted freely in the network, without regard to the confusion caused by automatic transcoding. Cons: For large strings too slow,
Mktime ()
Convert date and time to UNIX timestamp
Time ()
Gets the Unix timestamp for the current time
echo Date ("Y-m-d", Mktime (0,0,0,12,31,2013)). "";
Example: Calculates the age of a user by calculating the
Code can also be used to count the number of catalogs
Format output Directory size unit: BYTES,KB,MB,GB
function Getdirectorysize ($path)
{
$totalsize = 0;
$totalcount = 0;
$dircount = 0;
if ($handle =
The first snippet generates a random picture------code2.php
Open session to save the generated content
Session_Start ();
$table =array (
"Pic0" = "Dog",
"Pic1" = "Cat",
"Pic2" = "Fish",
Format time, a few minutes ago, a few hours ago
function Format_date ($time) {
$t = Time ()-$time;
$f = Array (
' 31536000 ' = ' year ',
' 2592000 ' + ' months ',
' 604800 ' = ' Week ',
' 86400 ' = ' Day ',
PHP ziparchive is a PHP extension class, you can easily achieve the zip file compression and decompression, before using the first to ensure that the PHP ZIP extension is open.
/* Description: A function that compresses
The following is an analysis of the distance code between the 2-point latitude and longitude of PHP calculation.
function Getdistancebetweenpointsnew ($latitude 1, $longitude 1, $latitude 2, $longitude 2) {
$theta =
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