Php simulates post requests

Php simulates post requests Class Request { Public static function post ($ url, $ post_data = '', $ timeout = 5) {// curl $ Ch = curl_init (); Curl_setopt ($ ch, CURLOPT_URL, $ url );

Use PHPMailer to send emails with attachments and HTML content

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 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

Collection class of PHP

Collection class of PHP Header ("Content-type: text/html; charset = utf-8 "); Class Collection { Private $ _ members = array (); Private $ _ onload; Private $ _ isLoaded = false;

PHP generates strings of any length + random numbers

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 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 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 uses imagecopy () to splice images

Php uses imagecopy () to splice images Php uses imagecopy () to splice images Header ("Content-type: image/jpeg "); $ Src_image [0] = imagecreatefromgif ("./1.jpg "); $ Src_image [1] =

PHP recursively execute the chmod command for folder recursion

PHP recursively execute the chmod command for folder recursion Function recursiveChmod ($ path, $ filePerm = 0644, $ dirPerm = 0755) { // Check if the path exists If (! File_exists ($ path )) {

PHP compressed image

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

Back up MySQL php

Back up MySQL php Define ('msb _ version', '1. 0.0 '); Define ('msb _ NL ', "\ r \ n "); Define ('msb _ string', 0 ); Define ('msb _ download', 1 ); Define ('msb _ save', 2 );

Php file upload example

Php file upload example File Uploader File Upload Select a file to upload: Uploader. php If ($ _ FILES

PHP array to generate CSV files

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 calculates the size of a folder.

PHP calculates the size of a folder. Function dirSize ($ directoty ){ $ Dir_size = 0; If ($ dir_handle = @ opendir ($ directoty )) { While ($ filename = readdir ($ dir_handle )){ $ SubFile = $ directoty.

PHP format the numbers in RMB with commas (,) for each three digits

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.

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 implements http login verification

Php implements http login verification /* Http authentication Determine the origin page Write logs */ //// // Disable the error report ////////////// Error_reporting (0 ); //// // Http

PHP processes Checkbox check box form submission

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 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

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 _

Total Pages: 12780 1 .... 12704 12705 12706 12707 12708 .... 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.