Code implementation of four basic sorting algorithms in PHP

Code implementation of four basic sorting algorithms in PHP Many people say that algorithms are the core of a program. the quality of algorithms determines the quality of the program. As a beginner phper, although seldom touched on

Php computing page execution time code

Php computing page execution time code Class c_Timer { Var $ t_start = 0; Var $ t_stop = 0; Var $ t_elapsed = 0; Function start () {$ this-> t_start = microtime ();} Function stop

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

PHP rounded to retain digits in decimal format

PHP rounded to retain digits in decimal format /** 1. number_format */ $ Number = 1234.56789; $ Nombre_format_francais = number_format ($ number, 2 ,',',''); $ English_format_number =

Php obtains the user's real IP address

Php obtains the user's real IP address If a user uses a proxy server, the real ip address is not in the HTTP_CLIENT_IP header, but needs to be resolved through the http header HTTP_X_FORWARDED_FOR. The following php functions:

Php generates image thumbnails (supported: JPEG, GIT, PNG, BMP)

Php generates image thumbnails (supported: JPEG, GIT, PNG, BMP) Class Thumb { Public function create ($ srcPath, $ dstPath, $ dstWidth, $ dstHeight) { If (! File_exists ($ srcPath )){ Return

Php code for generating image thumbnails

Php code for generating image thumbnails Multiple types of thumbnails are generated. /*************************************** * Author: beluckly) * Completion Time: 2006-12-18 * Class name: CreatMiniature

Php extracts the main color of the image

Php extracts the main color of the image $ I = imagecreatefromjpeg ("image.jpg "); For ($ x = 0; $ x For ($ y = 0; $ y $ Rgb = imagecolorat ($ I, $ x, $ y ); $ R = ($

Limit file download speed php code

Limit file download speed php code The following code limits the download speed in php: /* Source: http://www.apphp.com/index.php? Snippet = php-download-file-with-speed-limit */ /* Set here a limit of downloading

Common methods for exporting Excel files using PHP

Common methods for exporting Excel files using PHP /** * Export data to an excel table * @ Param $ data: A two-dimensional array with a structure similar to the array found from the database * @ Param $ title the

Php watermarking code for images

Php watermarking code for images Php watermarking code for images $ Source = imagecreatefromjpeg ('E:/image/guide_pic.jpg '); $ Thumb = imagecreatefromjpeg ('E:/image/l. JPG '); // Obtain the image width,

Php code for traversing all files and folders in a folder

Php code for traversing all files and folders in a folder Php traverses all files and folders in a folder Function list_dir ($ dirpath ){ If ($ dirpath [strlen ($ dirpath)-1]! = "\") {$ Dirpath. = "\\";} Static $ result_

Use PHPMail to send emails

Use PHPMail to send emails Function send_mail ($ title, $ content, $ from, $ to, $ charset = 'gbk', $ attachment = '') { Include '/class/PHPMail. class. php'; // Baidu Header ('content-Type: text/html; charset = '.

PHP ultimate encryption function

PHP ultimate encryption function // F (ucking) u (ncrackable) e (ncryption) function by BlackHatDBL (www.netforme.net) Function fue ($ hash, $ times ){ // Execute the encryption (s) as frequently times as the user wants

The mimetype type of the file obtained by PHP

The mimetype type of the file obtained by PHP /** * Obtain the mime type of the object. * @ Author xiaobing. meng * */ Class MimeTypes { Public static $ mime_types = array ( 'Apk '=>

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,

Common php regular expressions

Common php regular expressions Class Verify { /** * Verify the user name * @ Param string $ value * @ Param int $ length * @ Return boolean */ Public static function isNames ($ value, $

PHP Implements Fast sorting of arrays through iteration

PHP Implements Fast sorting of arrays through iteration Function quicksortX (& $ seq) { $ Stack = array ($ seq ); $ Sort = array (); While ($ stack ){ $ Arr = array_pop ($ stack ); If (count ($ arr)

Upload PHP images and generate thumbnails

Upload PHP images and generate thumbnails /** * Upload images */ Class imgUpload { Static protected $; Protected $ formName; // form name Protected $ directory; // upload a file to a directory

PHP: a common method for downloading images

PHP: a common method for downloading images Function getPicture ($ url, $ pictureName ){ If ($ url = "") return false; // Obtain the image extension $ Info = getimagesize ($ url ); $ Mime = $ info ['Mime '];

Total Pages: 12780 1 .... 9003 9004 9005 9006 9007 .... 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.