Instantiate a file on a special class
$fName = $this->_request->getpost (' fName ');
$adapter = new Zend_file_transfer_adapter_http ();
The folder where the uploaded files are stored
$adapter->setdestination
Else
The first step is to create the parser xml_parser_create (encoding);
$xml = xml_parser_create (' Utf-8 ');
xml_parser_set_option-option settings for the specified XML parsing
Practice writing your own database operations base class, containing the most basic curd operations. Can be integrated into the frame.
Configuration file
$db = Array (
' Host ' = ' localhost ',
' User ' = ' root ',
I am using the PHP date crawl
echo j7_getdate (' y-m-d ', ' 2010-11-15 ', ' +10 Day ');
function J7_getdate ($format, $time = ' Now ', $opt) {
Return date ("$format", Strtotime ("$time $opt"));
}
PHP read and split large filesIn PHP, the quickest way to read a file is to use functions such as file, file_get_contents, and a few lines of code. But when the file being manipulated is a large file, these functions may be out of the way, the
The code comes from PHP design mode.
?
/**
* from the sixth chapter of PHP design mode: Decorator mode
*
* Decorator design mode is suitable for the following work situations: Demand changes are fast and small, and
XPath lookup values for XML node and node properties
$xml = "
World
";
function Get_data_from_xml ($res _data, $node)
{
$xml = simplexml_load_string ($res _data);
Http://css.dzone.com/articles/retrieving-urls-parallel-curl
Class Footo_content_retrieve_http_curlparallel
{
/**
* Fetch A collection of URLs in Parallell using CURL. The results is
* Returned as an associative array,
Share the SQL anti-injection letter of the Discuz forum Number, good writing.
$magic _quotes_gpc = GET_MAGIC_QUOTES_GPC ();
@extract (Daddslashes ($_cookie));
@extract (Daddslashes ($_post));
@extract
PHP mysqli A number of query examples, interested friends can refer to the next.Mysqli_multi_query (mysqli link,string query) executes multiple queries consecutively, is a process-based msyqli_more_results (mysqli link) Primarily determines whether
share 21 common PHP function Code snippets
1. PHP can read random strings
This code creates a readable string that is closer to the word in the dictionary, and is practical and has password validation capabilities.
/*
Traverse all files and folders in a folder
function List_dir ($dirpath) {
if ($dirpath [strlen ($dirpath)]-1!= '/') {
$dirpath. = "/";
}
Static $result _array=array ();
if (Is_dir ($dirpath)) {
$files
The Mb_strlen and strlen functions of PHP make it easy to know the composition of a string Are all English, Chinese and English mixed, or pure Chinese characters. A brief description is given below (the sample program above) 1. If strlen returns the
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