To traverse all file and folder methods under a folder five

traverse all files and folders under a folder function List_dir ($dirpath) { if ($dirpath [strlen ($dirpath) -1]!= "\ \") {$dirpath. = "\ \";} static $result _array=array (); if (Is_dir ($dirpath)) {

Smarty Examples of pagination

@session_start (); Require_once ("smarty.php");//load Smarty template class Require_once ("adodb/adodb.inc.php");//Load ADODB Database Connecting to a database $dbhost = ' localhost '; Database server $dbuser = '

Example demo simple and common PHP paging class

Detailed Example Address: http://www.alleyloft.com/contents/share?id=3 /*********************************************** * @ Class Name: page * @ parameter: $myde _total-Total number of records * $myde _size-Number

In-depth understanding of ZF distribution cycle (dispatcher working principle)

Public Function fooaction () { Forward to another action on the current controller and module: $this->_forward (' bar ', NULL, NULL, array (' baz ' = ' bogus ')); } Public Function baraction () {

Copy move file-PHP

A simple example of writing elfinder, extracting key member methodsThe implementation features are:Implement multi-file copy or move operations Note: In order to facilitate the test, some judgments have been made simple treatment. And in the

PHP Encoding conversion function (automatic conversion character set supports array conversion)

Automatic conversion character set supports array conversion function Auto_charset ($fContents, $from = ' GBK ', $to = ' utf-8 ') { $from = Strtoupper ($from) = = ' UTF8 '? ' Utf-8 ': $from; $to = Strtoupper ($to) = = ' UTF8 '? ' Utf-8

Workarounds for undefined index and undefined variable appear in PHP

This hint is always present during the PHP project, initially using $act to accept the form POST data: $act =$_post[' act ';This hint is always present during the PHP project, initially using $act to accept the form POST data: $act =$_post[' act

I am using the PHP date crawl

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 run appears notice:use of undefined constant workaround

When modifying a program, it is suggested that notice:use of undefined constant is resolved by the following method, preferably error_reporting (0), without changing the configuration. When modifying a program, it is suggested that notice:use of

PHP function to convert Chinese characters to pinyin

/*--- * Function: Convert Chinese characters to pinyin * Function: Pinyin */ function Pinyin ($_string, $_code= ' gb2312 ') { $_datakey =

Examples of sending messages using the PEAR:NET_SMTP class

Require ' net/smtp.php '; $host = ' 126.com '; IP or domain name of the//SMTP server $username = ' arcow ';//user name of the login SMTP server $password = ' secret ';//Login to SMTP server password $from = ' jbxue@126.com '; Who

A method of English-Chinese mixed-line string interception in PHP

The Chinese and English mix counts, intercepts, does not use the custom function, but uses PHP's MB extension, uses the original ecology PHP function to handle the string interception easily.First, the following functions are used to intercept

PHP version for a friendly time display (ex: 2 hours ago)

Full PHP class, usually I will cooperate with smary use, quick use (plugins/function.rdate.php) /* * Data time functions. * Module */ Defined (' Tsky ') | | Die (' Permission denied! '); function

php Send mail

This is to use open source project Phpmailer to achieve the mail, first download the file, I download it here is 5.1 version, and then put three class.***.php files into the project file, I first use is Gmail, but failed, the problem is

The size of the file in bytes is converted to the appropriate unit representation

See someone sharing a code like this. Share a piece of code that supports any large number and is fairly simple. function Formatfilesize ($fileSize) { $unit = Array (' Bytes ', ' KB ', ' MB ', ' GB ', ' TB ', ' PB ', '

A simple PHP access counter

Start at the top of the page since we start a session Session_name (' Mysite_hit_counter '); Session_Start (); // $FN = ' hits_counter.txt '; $hits = 0; Read current Hits if ($hits = file_get_contents ($FN))

The difference between empty () and isset () functions

This article introduces the difference between empty and isset functions in PHP, and interested friends can refer to the learning. When using PHP to write a page program, I often use the variable handler function to determine the PHP page trailing

HTML Preview Regular Replace

HTML Preview Regular Replace /** * HTML replacement processing class, consider the following several substitutions * 1. IMG src: '/]+?) /I ' * 2. a href: '/]+? /I ' * 3. IFRAM.SRC: '/ ]+?)

Relative Time function

function Relativetime ($time = false, $limit = 86400, $format = ' g:i A M JS ') { if (Empty ($time) | | (!is_string ($time) &&!is_numeric ($time))) $time = time (); ElseIf (is_string ($time)) $time = Strtotime ($time); $now =

Determine if the input is purely digital, English, kanji, etc.

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

Total Pages: 5208 1 .... 2021 2022 2023 2024 2025 .... 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.