PHP Removal BOM Document

Remove the Utf-8 BOMs by magicbug at gmail dot com if (Isset ($_get[' dir '))) {//file directory to be removed, no parameter is the current directory of the file. $basedir =$_get[' dir ']; }else{ $basedir = '. '; }

PHP Web Capture

Header (' Content-type:text/html;charset=utf-8 '); /** * A class for grabbing pictures */ Class Download_image { Public $_save_path = NULL; Picture Save Road Strength Public $_limit_size = NULL; Picture Limit Size

PHP lists all tables in the database

!--? php $conn = @mysql_connect ("localhost" , "UserName", "password") or Die ("Sorry-could not connect to MySQL"), $rs 1= Mysql_list_dbs ($conn); for ($row =0; $row Mysql_num_rows ($rs 1); $row + +) { $this _db = Mysql_

PHP Random Display Image code

PHP generates a random number through the rand () function, which produces a specified range of numbersThis code randomly selects a picture by the resulting random number Srand (Microtime () * 1000000); $num =

PHP to disable characters before entering the database (PHP code functions)

//php to disable characters before entering the database (PHP code functions) function Safe_str ($str) { $ar Ray=array (' receive.php ', ' select ', ' Insert ', ' Update ', ' delete ', ' Union ', ' into ', '

PHP Analog POST request

Class request{ public static function post ($url, $post _data = ", $timeout = 5) {//curl $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_post, 1); if ($post _data! =

A simple PHP paging class code

Class Page { Private $total; Total number of records in the data table Private $listRows; Number of rows displayed per page Private $limit; Private $uri; Private $pageNum; Pages Private $config =array (' Headers ' and '

PHP Infinite Pole Classification related code

Non-recursive acquisition of all descendant classifications function get_offspring ($pids, $list) { $npid = Array (); $offspring = Array (); $has _child = true; while ($has _child) { $has _child = false;

PHP-based Water quality query API call code instance

Code Description: PHP-based water quality query API call code instanceAssociated data: Water qualityInterface Address: HTTP://WWW.JUHE.CN/DOCS/API/ID/34 // +----------------------------------------------------------------------// |

PHP download remote files to local stored code

function Grabimage ($url, $filename = "") { if ($url = = "") return false; if ($filename = = "") { $ext =STRRCHR ($url, "."); if ($ext! = ". gif" && $ext! = ". jpg") return false; $filename =date ("Dmyhis"). $ext; }

Self-growth counter

based on Redis self-growth counters, generate self-growth numbers /** * Generate self-growth numbers * * @param string $key cache key * @param int $step from growth step * @param int $expires cache

Zip compression code for PHP

$error = ""; Error holder if (Isset ($_post[' createpdf ')) { $post = $_post; $file _folder = "files/"; folder to load files if (extension_loaded (' Zip ')) {//Checking zip extension is available if (Isset ($post [' Files '])

PHP Read CSV file class

Define ("Csv_start", 0); Define ("csv_quoted", 1); Define ("Csv_quoted2", 2); Define ("Csv_unquoted", 3); function Readcsv ($fh, $len, $delimiter = ', ', $enclosure = ' "') { $data = Array (); $fildNr = 0;

PHP control File Download speed

/* Set here a limit of downloading rate (e.g. 10.20 kb/s) */ $download _rate = 10.20; $download _file = ' download-file.zip '; $target _file = ' target-file.zip '; if (file_exists ($download _file)) { /* Headers *

PHP traversal directory and file list

Define (' DS ', directory_separator); Class getdirfile{ Returns an array Private $DirArray = Array (); Private $FileArray = Array (); Private $DirFileArray = Array (); Private $Handle, $Dir, $File;

Use PHP to zoom in and out of images

function Resizeimage ($srcfile, $mySize) { $size =getimagesize ($srcfile); Switch ($size [2]) { Case 1: $img =imagecreatefromgif ($srcfile); Break Case 2: $img

PHP uses GD library to generate thumbnail images

Header ("CONTENT-TYPE:TEXT/HTML;CHARSET=GBK"); Ini_set ("Date.timezone", "Asia/chong"); Determine if the file is empty if (empty ($_files)) { echo "Upload file too large"; Exit } Determine if the file upload has

PHP uses GD to create thumbnails that maintain aspect ratios

/** * Create a thumbnail image from $inputFileName no taller or wider than * $maxSize. Returns the new image resource or false on error. * Author:mthorn.net */ function thumbnail ($inputFileName, $maxSize = 100) { $

An algorithm for fast ordering of PHP

Function Qsort (& $arr) { _quick_sort ($arr, 0, Count ($arr)-1); } /** * Fast sorting using recursive algorithm. * * @param array $arr to sort * @param int $low Lowest sort sub-segment * @param int $

PHP number converted to Kanji amount

/** * Number converted to Chinese * @param string|integer|float $num target number * @param integer $mode mode [true: Amount (default), false: normal digit representation] * @param boolean $sim use lowercase (default) *

Total Pages: 5208 1 .... 4282 4283 4284 4285 4286 .... 5208 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.