Use PHPMailer to send emails with attachments and HTML content
PHPMailer is an encapsulated PHP mail sending class that supports sending HTML content emails and adding attachments for sending. it is not like the mail () function of PHP
Sample code for writing data to a CSV file in php
Sample code for writing data to a CSV file in php
$ Row = 0;
Ini_set ('max _ execution_time ', 300 );
$ Cate; $ item; $ value; $ us;
$ Fp = fopen
PHP generates strings of any length + random numbers
You can customize what string to generate and how long it will take.
Function random ($ length)
{
$ Hash = '';
$ Chars = 'abcdefghijklmnopqrstuvwxyz01234
Source code of the string encryption and decryption function in PHP
Source code of the string function for encryption and decryption in PHP:
/**
* Function: encrypt strings.
* Parameter 1: content to be
Php code that intercepts strings according to the specified length
Php truncates a string based on the specified length. if the string exceeds the specified length, it will be replaced by.... However, this code does not support Chinese and
PHP compressed image
Function scale_dimensions_within_limits ($ w, $ h, $ max_w, $ max_h ){
// $ W is the width of the current rectangle
// $ H is the height of the current rectangle
// $ Max_w is the maximum width
PHP array to generate CSV files
A very simple function, from a PHP Group to generate a. csv file. This function uses the built-in fputcsv PHP function to generate comma-separated files (. CSV ). This function has three parameters: data,
PHP format the numbers in RMB with commas (,) for each three digits
Function num_format ($ num ){
If (! Is_numeric ($ num )){
Return false;
}
$ Rvalue = '';
$ Num = explode ('.', $ num); // separate
PHP calculates the length of time between two timestamps.
/**
* Returns the time of the two time ranges, * minute * second, * YEAR * month * Day * hour * minute * second
* @ Param int $ one_time time 1
* @ Param
PHP processes Checkbox check box form submission
Add [] to the name of the PHP form submission page check box so that the correct result can be obtained on the receiving page. After the form is submitted, an array is obtained, and the
Convert the time to the format of a few days ago or hours.
Convert the time to several days ago and hours, for example, "1 day ago" or "2 months ago.
Function prettyDate ($ date ){
$ Time = strtotime ($ date );
$
Php uses cookies to record the number of visits
$ F_open = fopen ("count.txt", "r +"); // open the specified file
$ Count = fgets ($ f_open); // read data from the file
If (empty ($ _ COOKIE ['cookie _
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