PHP header function output picture cache implementation code

Put this above any PHP image generation code: Session_Start (); Header ("Cache-control:private, max-age=10800, pre-check=10800"); Header ("Pragma:private"); Header ("Expires:".) Date (Date_rfc822,strtotime ("2 Day"));

PHP Array Page code example

$array =array ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");// Specifies the array to be paged $page = $_get[' page ']; $r = $this->page ($array, 5, $page); Print_r ($R)

PHP skillfully cache image files with 304 code

Private Function _addetag ($file) { $last _modified_time = Filemtime ($file); $etag = Md5_file ($file); Always Send headers Header ("last-modified:". Gmdate ("D, D M Y h:i:s", $last _modified_time). " GMT "); Header

PHP Extracts and downloads the image address in the CSS file

/** * Get image address in CSS and save to local */ Class Getincssimage { /** * Picture saved * @param URL address of $cssUrl CSS * @param $dir directory to save pictures * @return void */

PHP memcached data cache Getting Started example

Class Mycache { Private $cache; function __construct () { $this->cache = new Memcache (); You can replace the localhost by memcached server IP addr and port No. $this->cache->connect (' localhost ', 10987); }//

PHP Draw Pie chart (Imagefilledarc method)

!--? php $array = Array ("Beijing" =>1925, "Shanghai" =>2016, "Guangzhou" =>1256, "Shenzhen" =>980 ); $arr _key = Array_keys ($array); $color = Array (); $im = Imagecreatetruecolor (300,300);

Code for PHP Statistics page views (text cache)

/** @ Statistics page views Text cache @site http://bbs.it-home.org * */ Private function Visit ($id) { if (Isset ($GLOBALS [' Cfg_safe '] [' visit-article ']) && $GLOBALS [' Cfg_safe '] [' visit-article ']) {

Introduction to PHP Drawing Technology Primer

Basic steps in drawing technology prerequisites: Enable the GD library in the php.ini file Create Canvas The default background is black $img =imagecreatetruecolor (400,300); Draw various shapes Create a color $background =

PHP intercept string function, PHP custom string interception method

/** * Method Library-intercept string * @param string $string strings * @param int$length character length * @param string $dot whether to add after interception ... * @param string $charset encoding * @return String

What are the character security filter functions in PHP?

PHP character security filter functions, PHP to prevent SQL injection attacks and XSS attacks commonly used functions, including mysql_real_escape_string (), Addslashes (), Htmlentities (), Functions such as Htmlspecialchars (), Strip_tags ().

PHP Array function Implementation PHP paging

PHP Paging Code $array =array ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");// Specifies the array to be paged $page = $_get[' page ']; $r = $this->page ($array, 5,

Code to bulk import plaintext passwords into MySQL database

Set_time_limit (13600); Set the time $conn =mysql_connect (' localhost ', ' root ', '); Connecting to a database mysql_select_db (' csdn ', $conn); mysql_query ("SET NAMES UTF8"); $file =file (' csdn.txt '); foreach

Considerations for In_array Functions in PHP

Var_dump (In_array (0, Array (' s ')); Copy CodeResult: BOOL (TRUE).Because In_array will compare 0 and ' s ', 0 is the number type, ' s ' is a string type, and according to the instructions in the chapter "Comparison Operators" in PHP

PHP function GET_MAGIC_QUOTES_GPC

Echo GET_MAGIC_QUOTES_GPC (); I'm sorry, this is 0. Echo $_post[' LastName ']; Simao ' Pig echo addslashes ($_post[' LastName '); Simao\ ' Pig if (!GET_MAGIC_QUOTES_GPC ()) { $lastname = addslashes ($_post[' LastName ');

PHP Download the implementation code of the image in the CSS file

/* More & Original PHP framwork Copyright (c) 2007-2008 Ismole Inc. Author:kimi Documentation: Download the picture in the style file, water special Mr Skinner tool */ Note Set PHP timeout time Set_time_limit (0);

PHP saves binary raw data as an example of a picture

For PHP to save binary raw data as a picture file method, receive post over the binary raw data, select a generated path and the name of the picture, then write, need to refer to the friend. Example,PHP saves binary raw data for picture

PHP pagination Code details (with example)

Establishing a database connection $link = mysql_connect ("localhost", "Mysql_user", "Mysql_password") Or Die ("Could Not connect:". Mysql_error ()); Get the current number of pages if (Isset ($_get[' page ')) { $page =

thinkphp Memcache Cache Usage Example

about thinkphp usage in memcache, including memcache installation, how to run it in thinkphp, thinkphp In Memcache as an example of caching, a friend is required to refer to the below. !--ad-->!--ad--end--> thinkphp memcache Cache usage 1,

A simple example of PHP image processing function

Header (' Content-type:text/html;charset=utf-8 '); Image processing 1 set MIME type output type text/html default is page type can not write Header (' content-type:image/png; '); $width = 400; $height = 400;

Sell Moe teach everybody how to become programming cattle people

1.the skills an IT engineer should haveI think the practical skills include 3 aspects, 1:Figure 1All of these are important:Coding: You must be able to write high-quality code within a limited time.Experience: Experience shows that you are

Total Pages: 5208 1 .... 4276 4277 4278 4279 4280 .... 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.