Several examples of PHP reading csv file content
$ File = fopen('windows_201511s.csv ', 'r ');
While ($ data = fgetcsv ($ file) {// read the contents of a row in the CSV each time.
// Print_r ($ data); //
Php traverses folders and implements code editing and deletion.
/*
Function: (a) delete a file (B) edit a file, and delete a folder on a webpage (c), provided that the folder is empty (d) create a file or folder,
Php function for obtaining the folder size
// Get the folder size
Function getDirSize ($ dir)
{
$ Handle = opendir ($ dir );
While (false! ==( $ FolderOrFile = readdir ($ handle )))
{
If
Example of phpheader function usage (2)
Header ("Location: http://www.php.net ";);
Exit; // after each redirection, you must add "exit" to avoid errors and continue execution.
?>
Header
Php implementation code for exporting CSV files
// Note that the correct class path is included
Require_once (dirname (_ FILE _). '/export. php ');
$ Exceler = newJason_Excel_Export ();
//
The differences between time (), date (), and mktime () in php
Print (date ("l dS of f y h: I: s "));
Print ("July 1, 2000 is on a". date ("l", mktime )));
?>
Example 2:
$
Usage of the php function spl_autoload_register
Class {
Public function _ construct (){
Echo 'Got it .';
}
}
Then, there is an index. php that needs to use class A. The General syntax
Php intercepts the code of a specified length string
Share a function to intercept a specified length string. you can specify the length of the string to intercept and set the display content beyond the specified length. This function is
Implementation code of apc and file cache classes in php
Class CacheException extends Exception {}
/**
* Cache abstract class
*/
Abstract class Cache_Abstract {
/**
* Read cache
Measure the test taker's understanding about php multithreading.
This article introduces how to use multiple threads in php in a linux environment. For more information, see.The php multithreading knowledge shared in this section requires
Php multi-thread code sharing
This article introduces a class for implementing multithreading in php. For more information, see.How does one implement the multi-thread function of PHP through the WEB server? In php programming,
Example of phpsqlite_create_function
/**
* Sqlite_create_function example
* Edit: bbs.it-home.org
*/
Define ("PPO", 400 );
Function my ($ salary ){
Return $ salary/PPO;
}
Example of PHPheader function usage
Header ("Location: http://bbs.it-home.org ";);
Exit; // after each redirection, you must add "exit" to avoid errors and continue execution.
?>
Header
PHP code used to query the prvalue of a website
/*
* Function: encode the URL
* Parameter description: $ web_url URL, excluding "http ://"
* Site: bbs.it-home.org
*/
Function HashURL ($ url)
Difference between or and | AND & amp; in php
$ P = 6 or 0;
Var_dump ($ p); // int (6)
$ P = 6 | 0;
Var_dump ($ p); // bool (true)
$ P = 6 and 0;
Var_dump ($ p); // int (6)
$
POP3 class implemented by PHPSocket
/**
* PHP Socket POP3 class
* By bbs.it-home.org
*/
Class SocketPOPClient
{
Var $ strMessage = '';
Var $ intErrorNum = 0;
Var $
FTP class created by php (upload, download, move, create, etc)
This article introduces an ftp operation class implemented by php, which can upload, download, move, and create files. For more information, see.1. php ftp operation usage
2
Getting started with php array
This article introduces how to evaluate the difference set of php arrays. For more information, see.In php, evaluate the difference set of the array.The difference set function of the array is used: array_diff
Php regular expression to determine whether a string is a domain name
This article introduces how to use regular expressions to determine whether a string is a domain name in php programming. For more information, see.Generally, the domain
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