Introduction to PHP output_buffering cache usage

for ($i =0; $i echo $i. ''; Sleep (2); } ?> Copy CodeRun result: After all scripts have been run, the output will not be completed because the data is not full of a buffer size.Example

PHP GD library generates high quality thumbnails (example)

$FILENAME = "Image.thumb"; Create the width of the picture $RESIZEWIDTH = 400; Height of the resulting picture $RESIZEHEIGHT = 400; function Resizeimage ($im, $maxwidth, $maxheight, $name) { $width = Imagesx ($im);

Example of a PHP GD library generating thumbnails

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 Asynchronous request file Implementation multi-threaded code

$content = "; $fp = Fsockopen ("bbs.it-home.org", $errno, $errstr, 30); if (! $fp) { echo "$errstr ($errno)\ n "; } else { $out = "post/test.php?id=5". $content. " Http/1.1\r\n "; $out. = "host:www.php100.com\r\n";

PHP Excel Format (CSV) data import and export (sample)

$fname = $_files[' MyFile ' [' name ']; $do = Copy ($_files[' MyFile ' [' tmp_name '], $fname); if ($do) { echo "Import data successfully"; }else{ echo ""; } ?> error_reporting

Analysis of PHP variable scope and address reference problem

function test () { Static $b =0;//declaration of a statically variable, which is not used inside a function if it is declared outside the function. $b = $b +1; Echo $b; } Test ();//This statement outputs a

PHP Gets the function code of the website address

/** * Get the full address of the website * by bbs.it-home.org */ function Getrooturl () { $name = "; if (Isset ($_server[' http_host ')) { $name = $_server[' http_host '); }else{ $name =

A solution to the problem of PHP PDO code garbled

mysql_query ("Set names Utf8″); Copy CodeAs a result, the same approach is used. Solve the PDO Chinese garbled problem. $db = new PDO ($dbconn [' DNS '], $dbconn [' Dbuser '], $dbconn [' dbpwd ']); $db->query ("Set

PHP automatically generate thumbnails based on URL (with source code)

sudo a2enmod rewrite Copy CodeContents of the 2,.htaccess file: Rewriteengine on # '-S ' (is regular file, with size) # '-l ' (is symbolic link) # '-d ' (is

The interception function of mixed strings in PHP

/** * Capture mixed strings in English and Chinese * by bbs.it-home.org */ function Mb_str_split ($string) { # Split at all position no after the start: ^ # and not before the end: $ $string = Iconv (' gb2312 ', '

A simple example of PHP exporting a CSV file

/** * Export CSV file, header function example * edit:bbs.it-home.org */ Header ("Cache-control:public"); Header ("Pragma:public"); Header ("Content-type:application/vnd.ms-excel"); Header

Workaround for problems with PHP Curl post

$data = Array (' Title ' = = $title, ' Content ' = $content, ' comefrom ' + $comefrom); curl_setopt ($ch, Curlopt_dns_use_global_cache, false); curl_setopt ($ch, Curlopt_url, ' http://example.com/b.php '); curl_setopt ($ch, Curlopt_

PHP MySQL Order by keyword usage

SELECT column_name (s) From table_name ORDER by column_name Copy CodeNote: SQL is not case sensitive. Order BY is equivalent to order by.example, select all the stored data in the "Persons" table and sort the results

PHP Breakpoint Continuation Download Sample code

$fname = './test.mp3 '; $fp = fopen ($fname, ' RB '); $fsize = FileSize ($fname); if (Isset ($_server[' Http_range ')) && ($_server[' http_range ']! = ") && preg_match ("/^bytes= ([0-9]+)-$ /i ", $_server[' Http_range '], $match) && ($

Sample code for PHP thumbnail fills with white edges

The path to the source map, either a local file or a remote picture $src _path = ' 1.jpg '; Finally save the width of the picture $width = 160; The final saving picture of the high $height = 120; Source Graph Object

Modify PHP Upload limit modify phpMyAdmin limit

Found it Options FollowSymLinks AllowOverride None Revision changed to Options FollowSymLinks AllowOverride All You can do it.

Phpexcel importing Excel to MySQL database (sample)

Copy Code2, Execution page insertdb.php Session_Start (); Header ("Content-type:text/html;charset:utf-8"); Global variables $SUCC _result=0; $error _result=0; $file =$_files[' filename ';

Modify PHP upload File size limit

Introduced under the revised PHP upload file size limit method, php default file upload size of 2M, here to share the specific method of modification, there is a need for friends reference.The default page execution time in 1,php is 30 seconds. That

PHP generates a column ordinal in Excel

/** * Generate serial numbers in Excel or CSV files with PHP code */ Public Function loop () { $loop = 0; $charnum = 65; for (; $loop $quotient = Intval ($loop/26); $remainder = $loop% 26; $f = $

PHP to judge the constellation's function code according to the date

function Yige_constellation ($month, $day) { Checking parameter validity if ($month | | $day ) return false; Constellation Name and start date $constellations = Array ( Array ("+" = "Aquarius"), Array ("+" = "pisces"),

Total Pages: 5208 1 .... 4761 4762 4763 4764 4765 .... 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.