PHP generates a histogram instance code

/*php Generate histogram */ function CreateImage ($data, $twidth, $tspace, $height) { $dataName = Array (); $dataValue = Array (); $i = 0; $j = 0; $k = 0; $num = sizeof ($DATA); foreach ($data as $key = = $val)

PHP pagination Class code, with a nice style PHP page code

Include "pager.class.php"; $CurrentPage =isset ($_get[' page ')? $_get[' page ']:1; Die ($CurrentPage); $myPage =new Pager (1300,intval ($CurrentPage)); $PAGESTR = $myPage->getpagercontent (); Echo $pageStr;

PHP Paging principle and Page Jump instance

SELECT * FROM table limit 0,10//Top 10 records SELECT * FROM table limit 10,10//11th to 20th record SELECT * FROM table limit 20,10//21st to 30th record ...... Copy CodeThis set of SQL statements is actually a

Thinkphp Curd method of order Method tutorial detailed

$Model->where (' Status=1 ')->order (' id desc ')->limit (5)->select (); Copy CodeNote: There is no order for coherent operations, and you can arbitrarily change the order of calls before the Select method is called.Support for sorting multiple

PHP Paging principle Analysis, PHP page code simple example

$pages = range (1, 100); Number of records $page _list[' End ' = (count ($pages)/10)? Ceil ((count ($pages)/10)): 0; Total pages Last page $step = isset ($_get[' step ')? $_get[' Step ': 5; Step $curr _page = isset ($_get[' curr_page '

PHP uses memcached cache for data deletion

Create a Memcache object instance $memcache = new Memcache; if (! $memcache->connect ("127.0.0.1", 11211)) { Die (' connection failed '); } if ($memcache->set (' Key1 ', "Xian", memcache_compressed,60)) {

A comprehensive example of PHP paging principle and PHP page code

/** * PHP Paging code * */ /** * Link Database * bbs.it-home.org * @param string $strHost database server host Address * @param string $strAccount Database account * @param string $strPassword database

Php+ajax image file asynchronous upload sample code

Jquery.extend ({ Createuploadiframe:function (ID, URI) { Create frame var Frameid = ' juploadframe ' + ID; var iframehtml = ' Copy CodeIndex.js file:

CodeIgniter enable cache and clear Cache method sharing

This article describes how CodeIgniter enables caching and clearing the cache, depending on the page cache, the page can be nearly static page loading speed, because the results of the program output saved to the hard disk. CodeIgniter

PHP Chinese Coding Problem Solving method Summary

Header ("content-type:text/html; Charset=xxx ") Adddefaultcharset xxx Copy CodeIt is recommended to add a header for each page ("content-type:text/html; Charset=xxx "), so that it can be displayed correctly on any server, portability is

Phpexcel two ways to read Excel files

/** * * @copyright 2007-2012 Xiaoqiang. * @author Xiaoqiang.wu * @version 1.01 */ Error_reporting (E_all); Date_default_timezone_set (' Asia/shanghai '); /** Phpexcel_iofactory */

Useful PHP Paging class, a variety of page styles

Copy Code Class subpages{ Private $each _disnums;//The number of entries displayed per page private $nums;//Total number of entries Private $current _page;//the currently selected page Private $sub _pages;

Phpexcel example of generating and reading Excel files

Require_once ' classes/phpexcel/reader/excel2007.php '; Require_once ' classes/phpexcel/reader/excel5.php '; Include ' classes/phpexcel/iofactory.php '; function Arraytoexcel ($data) { $objphpexcel = new Phpexcel ();

Yii Paging Method (Controller and view paging)

yii

Public Function Actiontest () { $criteria =new Cdbcriteria; $criteria->order= ' id DESC '; $count =user::model ()->count ($criteria); $pager =new cpagination ($count); $pager->pagesize=10;

Mind the sea, dare to dare to do

It's always so fast in a brother's day, Always feel the time is so from the point of flow away, trying to hold tight, but powerless! Now it is almost time to sprint, the knowledge of the brain loaded, but are fragmented, has not been strung into a

Considerations for PHP uploading files under Linux

Chmod-r 777 HTML Copy CodeModify a directory for any user with write read Execute permission chmod a+rwx HTML Copy Code2. Set the root directory of the uploaded files Siteroot

PHP Filter HTML Web site link PHP implementation of the domain name whitelist function

!--? php /** * Filter Outbound links * @param array $local _domain domain name Arrays * @param string $message text content */ function replace_outer_links ($local _domain_arr,

PHP Chinese Array Sorting Method Example

Function Utf8_array_asort (& $array) { if (!isset ($array) | |!is_array ($array)) { return false; } foreach ($array as $k = = $v) { $array [$k] = iconv (' UTF-8 ', ' GB2312 ', $v); } Asort ($array);

Example of a thumbnail function generated by a scaled image of PHP

/* * @im//Picture resources that need to be scaled * @filetype//production of thumbnail file type * @dstimW//Zoom the width of the picture * @dstimH//height of the picture to zoom * @thumbname//thumbnail file name

PHP Simple paging principle and pagination code example

/******* Paging principle *********/ Number of record bars per page $page _size = 3; $sql = "SELECT * from Message"; $result = mysql_query ($sql); Total number of records $num = mysql_num_rows ($result);

Total Pages: 5208 1 .... 3635 3636 3637 3638 3639 .... 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.