Common methods for exporting Excel files with PHP

/** * Export data as Excel table * @param $data A two-dimensional array, structured like an array found from a database * @param $title The first row of Excel header, an array, if empty, no caption * @param $filename downloaded

PHP Implementation zip Compression decompression General function

function Ezip ($zip, $hedef = ") { $dirname =preg_replace ('/.zip/', ', $zip); $root = $_server[' Document_root '). ' /zip/'; Echo $root. $zip; $zip = Zip_open ($root. $zip); Var_dump ($zip); @mkdir ($root. $hedef.

Convert PDF to PHP code in PNG format using Imagick Library

function Pdf2png ($PDF, $Path) { if (!extension_loaded (' Imagick ')) { return false; } if (!file_exists ($PDF)) { return false; } $IM = new Imagick (); $IM->setresolution (120,120);

PHP code accessed via Curl login

$data = ' username=zjzhoufy@126.com&password=1q2w3e&remember=1 '; $curlobj = Curl_init ();//initialization curl_setopt ($curlobj, Curlopt_url, "Http://www.imooc.com/user/login");//Set the URL to access the Web page curl_setopt

PHP File Upload Example

File Uploader File Upload Select a file to upload: Copy Codeuploader.php !--? php if ($_files[' file ' ['

PHP generated image thumbnail code class

Generate multiple types of thumbnails /*************************************** * Author: Fall Dream Scorpio (beluckly) * Completion time: 2006-12-18 * Class Name: Creatminiature * Function: Generate multiple

PHP analog Post send data

$flag = 0; The data to post $ARGV = Array ( ' var1 ' = ' abc ', ' var2 ' = ' How are you '? Constructing the Post string foreach ($argv as $key = = $value) { if ($flag!=0) { $params. = "&"; $flag = 1;

PHP code backup MySQL Database

$Database _name = ' somedb '; $table = ' sometable '; Define (' H ', ' localhost '); Define (' N ', ' root ') define (' P ', ' password '); Define (' T ', $database _name); Mysql_connect (H, N, P) or Die (Mysql_error ());

PHP implements a simple source syntax highlighting function

A PHP implementation of a simple syntax highlighting function, Note: This function design is relatively simple, may not highlight some of the syntax, you can expand the function function Syntax_highlight ($code) { This matches--"

Creating directories and File writes

Create directories as well as file writes, as required by friends can refer to below. Requirements Description:Generates a static HTML page of the previewed PHP page and stores it in the appropriate folder.1. The preview information is the query

Backing up MySQL's PHP class

Define (' msb_version ', ' 1.0.0 '); Define (' Msb_nl ', "\ r \ n"); Define (' Msb_string ', 0); Define (' Msb_download ', 1); Define (' Msb_save ', 2); Define (' __sep__ ', "/*sep*/"); Set_time_limit (

PHP implements a simple symmetric encryption and decryption method

/** * Universal Encryption * @param string $string strings that need to be encrypted * @param String $skey Encryption Eky * @return String */ function EnCode ($string = ', $skey = ' echounion ') { $skey =

PHP Send e-mail class

/*********************************************************************************** Instructions for use: $m = new Sendm (' SMTP server address ', ' account ', ' Password ', port (int), timeout retry time (int)); $m-

PHP implementation of escape and unescape functions in JavaScript

Escape function /** * JS Escape PHP implementation * @param $string The sting want to be escaped * @param $in _encoding * @param $out _encoding */ function Escape ($string, $in _encoding = '

PHP's function of turning a color deep

This PHP function can make the specified color even deeper Some function Colordarken ($color, $dif =20) { $color = str_replace (' # ', ", $color); if (strlen ($color)! = 6) {return ' 000000 ';} $rgb = ';

How to prevent image hotlinking under Apache server

First explain a chain of anti-theft and steering:What is the use of image anti-theft chain?Prevent other websites from stealing your pictures and wasting your valuable traffic.What is the use of picture steering?If your site to picture-based, which

PHP implementation calculates the size of a folder

function Dirsize ($directoty) { $dir _size=0; if ($dir _handle= @opendir ($directoty)) { while ($filename =readdir ($dir _handle)) { $subFile = $directoty. Directory_separator. $filename; if ($filename = = '. ' | |

PHP forces users to download by adding HTTP response headers

PHP can be content-type by setting the header, forcing users to download content, rather than directly in the browser open, the following code implementation:downloadfile.php $filename = $_get[' file ']; Get the Fileid from the

PHP implementation calculates the length of time between two timestamps

/** * Return two time apart time, * year * month * day * minutes * seconds * @param int $one _time time One * @param int $two _time time Two * @param int $return _type default value is 0,0/not 0 stitching back, 1/* seconds, 2/*

Using singleton mode to implement MySQL class

Defined (' ACC ') | | Exit (' Access Denied '); Encapsulates the MySQL operation class, including the connection function, and the query function. Class MySQL extends absdb{ protected static $ins = NULL; protected $host; Host

Total Pages: 5208 1 .... 2660 2661 2662 2663 2664 .... 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.