In bulk data acquisition in PHP rarely use the file_get_contents function to operate, but if it is a small amount of we can use the file_get_contents function, because it is not only useful and easy to learn, let me introduce file_get_ Contents
To use PHP to get all the pictures in the article in the first picture, we just need a simple regular expression can be achieved, the following small series to share two examples of it.
First look at a function:
The code is as follows
PHP retrieving a specific time range
Directory
Preface
Purpose
Functions and items
Usage
Code and comments
Preface:
In general, I should be an android mobile developer rather than a phper. if I only use mobile apps, I will not learn so
Let's take a look at the PHP manual about the file_get_contents () function to read the entire file into a string and file (), unlike the file_get_contents () that reads the files into a string.
The file_get_contents () function is the preferred
The question about json transmission between different pages in PHP is gettest. php: & lt ;? Php & nbsp; $ value ["name"] = & nbsp; urlencode ("myname"); $ value ["pass"] = & nbsp; urlencode ("pass888"); $ value ["json transfer between different PHP
: & Lt ;? Phpecho & quot; host name of the current script server: & quot ;. gethostbyaddr ($ _ SERVER ['remote _ ADDR ']). & quot; & lt; br/& gt; & lt; hr/& gt; & quot; echo & quot; get the PHP script currently running (page) IP address of the
PHP is a great web development language and flexible language, but we can see some mistakes made by php programmers. I made the following list to list the 10 errors that PHP programmers often make, most of which are related to security. Look at some
echo "host name of the current script server:". gethostbyaddr ($_server[' remote_addr '). "
"Echo" gets the IP address of the server where the PHP script (page) is currently running: ". $_server[' Server_addr ')."
"echo" gets the hostname of
PHP File Upload code writing process
1. First determine whether to upload the file
2. If there is any further error in the upload
3. If an error occurs, an error message is indicated
4. If no error is found, then determine the file type
5. If the
Don't say much nonsense, just go to the code!
Copy CodeThe code is as follows:
Class Macaddr{Public $returnArray = Array ();Public $macAddr;function __contruct ($os _type=null) {if (Is_null ($os _type)) $os _type = Php_os;Switch (Strtolower ($os
Doctype html Public " -// W3C // dtd html 4.01 transitional // en " > Html > Head > Title > Hello JQ Title > Meta HTTP - Equiv = " Content-Type " Content = " Text/html; charsets = UTF-8 " > Script
Copy CodeThe code is as follows:
Nationwide, judging whether the $request_uri contains HTML
if (!strpos ($_server["Request_uri"], ". html"))
{
$page = "http://qq.ip138.com/weather/";
$html = file_get_contents ($page, ' R ');
$pattern = "/
National
Iterator mode
Echo ' program start: '. Time (). '
';
$path = ' d:/www ';
Getrevdir ($path);
Echo ' program end: '. Time (). '
';
Exit
Echo '
';Get all directories and filenames under the current pathThis usage is mainly used in the B/s program to
When studying the components that Yii supports, I find that PHP does not support the Memcache module, so I try to expand it.
Native Environment: win8.1
Development environment: PHP 5.5
The first step: first to download the required file
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.