PHP XML File parsing class (demo code included)

/** XML File parsing classes * DATE:2013-02-01 * Author:fdipzone * ver:1.0 * Edition bbs.it-home.org * Func: * Loadxmlfile ($xmlfile) read in XML file output array * Loadxmlstring ($xmlstring) read into xmlstring

Sample code for PHP to determine if an array is ordered

/** * Determine if the array is ordered * by bbs.it-home.org */ function Judegsortarray ($array) { if ($array [0] > $array [1]) { $flag = 1; } else { $flag = 0; } $temp = $flag; $len = count

PHP5 installing GD library step sharing

CD libpng-1.2.40 MV Scripts/makefile.linux./makefile #一定要使用script下的Makefile, do not pass./configure Copy CodeGenerated: Make Make install Copy Code2, download FreeType Library, many GD

PHP implementation file force download code

/** * PHP Mandatory download file * edit:bbs.it-home.org */ $file _dir = "./"; $name = "Test.txt"; $file = fopen ($file _dir. $name, "R"); Header ("Content-type:application/octet-stream"); Header

PHP Large File Upload problem analysis

Introduction of the next PHP upload large file configuration method, on some PHP upload parameters to explain how to implement a large file upload in PHP, the need for a friend reference.PHP File upload Required parameters: A few parameter

PHP force download code for PDF files

Forcedownload ("Pdfdemo.pdf"); function Forcedownload ($filename) { if (false = = File_exists ($filename)) { return false; } HTTP headers Header (' content-type:application-x/force-download '); Header

PHP configuration file detailed php.ini file detailed

This article is PHP configuration file php.ini Chinese annotation version, PHP configuration file in detail, the need for friends to do a collection, the key time to use.This section contains a detailed description of the PHP configuration file, php.

PHP function Get_headers is a HEAD request or GET request

$imageurl = ' http://127.0.0.1/1.png '; $headers = Get_headers ($imageurl); Copy CodeIn fact, the picture is also a local image, but it is really "remote", remote images can also be understood as a URL address of the picture.Use

PHP Infinite Traversal Directory code

!--? php if (Isset ($_get[' id ')) { $s =$_get[' id ']; chdir ($s); } echo ' currently in '. GETCWD (), ' '; $a =opendir ('. '); while ($c =readdir ($a)) {

PHP Bubble sorting algorithm implementation code

!--? php //bubble sort function //This function uses references to avoid memory consumption //collation: bbs.it-home.org functi On &bubble (& $arr) { $count =count ($arr); if ($count

PHP export (Generate) CSV file for a small example

/** * Generate a comma-delimited CSV file by default * FIX: Content contains comma (,), double quotation mark ("") * @author ZF Edit:bbs.it-home.org * @version 2012-11-14 */ Header ("Content-type:application/

Implementation code for PHP kanji to pinyin

/*** * pinyin.php * Example:pinyin (' Zhang Honghua ', 1); The second parameter is arbitrarily set to UTF-8 encoding to NULL the default is GB encoding * edit:bbs.it-home.org **/ function Pinyin ($_string, $_code= ' gb2

PHP replaces sensitive string classes (with source code)

/** String Filter Class * date:2013-01-09 * Author:fdipzone * ver:v1.0 * edit:bbs.it-home.org * Func: * Public replace replaces illegal characters * Public check Check to see if illegal characters are included

Code examples for PHP to prevent SQL injection

Function Inject_check ($sql _str) { Return eregi (' select|insert|and|or|update|delete|\ ' |\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile ', $sql _str) ; } if (Inject_check ($_server[' query_string ')) ==1 or Inject_check

Ways to export and download files from PHP

Header ("Content-type:application/vnd.ms-excel") Copy CodeIf you want to be able to provide that open/Save dialog box, the Content-disposition parameter, the content-disposition parameter is intended to provide a suggested file

Phpexcel Sample code to import Excel data

<>/** * Import Commodity basic information * edit:bbs.it-home.org */ Public Function Importproductbasicinfo ($data) { Include_once ' phpexcel.php '; Include_once ' phpexcel/iofactory.php '; Include_once '

PHP implements a two-dimensional code with custom images in the middle

Class qrcode{ public $w; Public $h; Public $s; function __construct ($w 1, $h 1, $s 1) { $this->w = $w 1; $this->h = $h 1; $this->s = $s 1; $this->outimgase (); } function QRCode () { $post

PHP get (read) local file and remote file content example

$file = ' jbxue.com.php '; Remote is not supported $fso = fopen ($file, ' R '); echo $data = Fread ($fso, FileSize ($file)); Fclose ($FSO); ?> Copy Codefopen () binds the name resource specified by file

PHP header function File download direct prompt to save

$filename = ' path + actual filename '; Types of files Header (' content-type:application/pdf '); Download the displayed name Header (' content-disposition:attachment; filename= ' file name when saving. pdf "');

PHP file system detailed (recommended)

$filename = "./files.text"; $FP =fopen ($finename, "RB"); $encho fread ($fp, 100); ?> Copy CodeReadFile (), file (), and file_get_contents () functions.   ReadFile (), file (), and file_get_contents () functions. int

Total Pages: 5208 1 .... 2030 2031 2032 2033 2034 .... 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.