Php exception handling, error throw, and error callback functions
Try {
// You codes that maybe cause an error
} Catch (Exception $ err) {// The type of this error object needs to be declared. Exception is
The simplest example of php word generation
Class word
{
Function start ()
{
Ob_start ();
Print'Xmlns: w = "urn: schemas-microsoft-com: office: word"
Xmlns =
Php method for quickly creating arrays (application of function range)
$ Numbers = range (); // use range to directly create 1 ~ 9. an array composed of 9 numbers. it ends with "1" and "9.
Echo $ numbers [1]; //
Php simple array sorting method
$ Arr = array ('20140901', '20160901', '20160901 ');
The code above creates an array with three values. The numeric index of the PHP array starts from 0. Therefore, the value of $ arr [0]
Php calls WebService to pass the time parameter
When WEBSERVICE is connected with other systems, it is found that PHP cannot identify time parameters in. NET. Analysis: WEBSERVICE code calling in PHP is implemented by manually compiling
How to solve php Chinese character garbled characters and Chinese character warehouse garbled characters
/*
@ Solution to garbled characters in Chinese characters
@ Bbs.it-home.org
*/
Include_once
Php functions for calculating the length of a Chinese string and intercepting a Chinese string
Header ('content-type: text/html; charset = utf-8 ');
/**
* Function used to count the length of a Chinese
Function of intercepting a Chinese character string in php
/**
@ Chinese string truncation function
@ Http://bbs.it-home.org
*/
Function cnSubStr ($ string, $ sublen)
{
If ($ sublen> =
Php array converted to xml code
Class ArrayToXML
{
/**
* The main function for converting to an XML document.
* Pass in a multi dimen1_array and this recrusively loops through and builds up an XML
Php code used to determine the browser type, browser language, and other information
// Determine the browser type
Echo $ _ SERVER ["HTTP_USER_AGENT"];
// Determine the browser language
Echo $ _ SERVER
Php functions for generating random user names and passwords
Description: generate a random user name and password. you can use the mt_rand or rand function in php. now the rand function is used more in the verification code, most of
Php function for converting RMB into uppercase Chinese
/**
Convert RMB amount to Chinese capital
Link: bbs.it-home.org
Date: 2013-2-28
*/
Function cny ($ ns ){
Static $ cnums =
Eight bad habits to overcome during Website Development
In the field of website development, many problems are caused by some bad programming habits. Eliminating these bad habits makes your development easier and more efficient.1. spelling
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