example, FFmpeg read video playback time length and bit rate
The code is as follows:
The code is as follows
Copy Code
Define (' Ffmpeg_path ', '/usr/local/ffmpeg2/bin/ffmpeg-i '%s ' 2>&1 ');function Getvideoinfo ($file)
Example 1
The code is as follows
Copy Code
/** Function: PHP a variety of ways to achieve the perfect download remote pictures saved to local* Parameters: File URL, save file name, use the download method* Use the
The code is as follows
Copy Code
/*socket send and receive data@host (string) socket server IP@post (int) port@str (string) the data to send@back 1|0 socket end has data returnReturns true|false| server-side data*/function
Method One
The code is as follows
Copy Code
function Generate_password ($length = 8) { //password character set, you can add any character you need $chars = ' Abcdefghij
Matching regular expressions for Chinese characters: [U4E00-U9FA5]Commentary: Matching Chinese is really a headache, with this expression will be easy to do
Match Double-byte characters (including Chinese characters): [^x00-xff]Commentary: can be
The code is as follows
Copy Code
?/*** Manipulating file Classes*Example* Fileutil::createdir (' A/1/2/3 '); Test build folder Build a A/1/2/3 folder* Fileutil::createfile (' B/1/2/3 '); Test build file Build a 3 file under the b/1/2/
PHP for Windows bugsReference:
The first is the possibility of:
Get rid of eaccelerator extensions in PHPThis will solve your problem, but it may increase the system burdenBecause Eaccelerator is mainly to save the system resources of Things
The
1, the easiest way is not to use the php5.1 version2, if you must use, and can not modify the php.ini, you need in the initialization of the statement of the timeAdd Date_default_timezone_set (XXX) above;3, once and for all, only can modify php.ini.
Direct installation:
CentOS Installation:
The code is as follows
Copy Code
Rpm-qa |grep PHP-GD
If it does not exist then execute the following:
The code is as follows
Copy Code
Yum
Foreach performs operations on array replicas (by copying arrays), while operations are performed by moving internal indicators of the array. Generally, it is logically considered that, while should be faster than foreach (because foreach first
Xdebug installation stepsXdebug is a module of php and needs to be compiled and installed. php installed with lnmp is installed to/usr/local/php by default, and a hard link to/usr/bin is made.Compile xdebug first The code is as follows:Copy code
Php header () page jumpI migrate the blog from http: // www. Your domain name/blog to the http://www.111cn.net domain name, when the user visits the previous blog address, automatically jump to the corresponding article of the current blog The code
Define false user browser information HTTP_USER_AGENT The code is as follows:Copy code $ Binfo = array ('mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0 ;. net clr 2.0.50727; InfoPath.2; AskTbPTV/5.17.0.25589; Alexa Toolbar) ',
System functionsNote: execute an external program and display the output information.Syntax: string system (string command, int [return_var]);Return value: stringDetails:This function is like the system () function in C, used to execute commands and
Upload operation code The code is as follows:Copy code If ($ _ FILES ['myfile'] ['error']> 0) {// checks whether the file is successfully uploaded to the server. 0 indicates that the file is successfully uploaded.Echo 'Error :'; Switch ($ _
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