The code that calculates the maximum and minimum values of the PHP array. For more information, see.
Copy codeThe code is as follows:
$ Fruits = array ("155: vbscript: http://www.bitsCN.com/list/list_114_1.htm", "1: javascript:
The end () function points the internal pointer of the array to the last element and returns the value (if successful) of the element ). Definition and usage
The end () function points the internal pointer of the array to the last element and
The array_combine () function combines two arrays to create a new array. one of the arrays is the key name, and the other array is the key value.
Array_combine () definition and usageThe array_combine () function combines two arrays to create a new
The in_array () function searches the array for the specified value in_array (). definition and usage
The in_array () function searches for the given value in the array.
Syntax
In_array (value, array, type)
Parameter description
Value is required.
In php, you can modify the function code of file extension in batches. For more information, see.
Copy codeThe code is as follows:
Function foreachDir ($ path ){
$ Handle = opendir ($ path );
If ($ handle ){
While (false! ==( $ File = readdir
The array_unique () function removes repeated values from the array and returns the result array. When the values of several array elements are equal, only the first element is retained, and other elements are deleted.
Array_unique () definition
The browser and server communicate with each other over the connectionless HTTP protocol. connectionless programs are characterized by client requests to the server. the server outputs the corresponding program according to the request, if the
Traditionally, when an array is null, it usually uses count or key, and it is very troublesome to use multi-dimensional arrays.
Copy codeThe code is as follows:
// Determine whether an array is empty
/**
Array (
); Null
Array (
Array (
),
What are CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI? In the php runtime environment configuration, which one is more suitable for websites.
What is CGI?
CGI is a Common Gateway Interface. it is a tool for the HTTP server to "talk" with programs
You need to determine whether the remote URL is valid. the remote url includes remote images, webpages, videos, and other elements. you can select multiple methods as needed. Solution:
PHP solution
Use the file_get_contents function. However, if the
Php uses curl to determine whether a remote file exists. some of our programs need to determine whether the file exists before performing subsequent operations.
Copy codeThe code is as follows:
// Determine the remote file
Function check_remote_file_
Determine whether a url can be accessed normally. avoid the use of file_get_contents because the url cannot be accessed, resulting in a fatal error and program termination problems.
Copy codeThe code is as follows:
$ Url = 'http: // www.baidu.com '
When we post on a forum, post a comment, or use a QQ space to publish a log or Weibo post a comment, the published content is displayed as "just", "5 minutes ago", and "Yesterday, instead of displaying the specific date and time directly. This
Some functions of the mysql module in php are simply encapsulated. many cms packages some mysql operation code classes. for details, refer.
Copy codeThe code is as follows:
Class mysql
{
Private $ db; // datebase connect
Private $ result; // mysql
Php file cache function. For more information, see.
Copy codeThe code is as follows:
Function createHashDir ($ sign)
{
$ Md5 = md5 ($ sign );
If (! Is_dir (MB_CACHE) mkdir (MB_CACHE );
For ($ I = 1; $ I {
$ Dir. = $ md5 {$ I }.'/';
If (! Is_dir
This function mainly uses the file modification time function filemtime and the current time-frame subtraction method to determine whether to update the content.
Copy codeThe code is as follows:
// This function uses the file modification time
PHP uses the shell background to run the PHP script and obtain the ProcessID code of the script. For more information about php, see.
Copy codeThe code is as follows:
$ Command = '/usr/bin/php/pub/www/u111/job/Crondo/auto_collector.php &';
$
Php checks whether the string is full of Chinese characters or the implementation code that contains Chinese characters. it mainly uses regular expressions to match Chinese characters. I. All judgments are in Chinese.
Copy codeThe code is as
In php, the two methods of simulating POST data transmission are shared. sometimes you need to simulate and submit data for easy data collection. For more information, see. Method 1
Copy codeThe code is as follows:
$ Ch = curl_init ();
Curl_setopt (
Google found that Ffmpeg can be used to obtain video information for half a day. First, let's introduce FFMEPG.
Problem description; obtain the thumbnail and video duration of the flv video.
Google found that Ffmpeg can be used to obtain video
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