A function used to calculate the runtime of the PHP page.
CopyCodeThe Code is as follows: /*
@ Computing PHP
ProgramRunning time
*/
Function microtime_float ()
{
List ($ USEC, $ Sec) = explode ("", microtime ());
Return (float) $ USEC +
In ascending order of magnitude, common time Complexities include: constant order O (1), logarithm order O (log2n), linear order O (n), linear logarithm order O (nlog2n ), square order O (n2), cubic order O (n3)
Copy codeThe Code is as follows: //
I. Introduction to opensslData Encryption is an important part of information transmission. Any information is transmitted in plain text, which is indeed very insecure,Data must be encrypted. plaintext data must be converted to ciphertext data
I haven't written any post for a long time. I have been busy with new projects. Recently, I have been trying to develop a simple and generous Verification Code Program, which is difficult to identify automatically. After collecting these data, we
This is the default Implementation Method to extend the select of yibing.
Copy codeThe Code is as follows:
Value = "1"> residential
Value = "2"> Office
Value = "3"> business Room
Value = "4"> plant
Value = "5"> repository
Value = "6">
(1) Using functions provided by php, array_unique and array_diff_assoc
Copy codeThe Code is as follows: Function FetchRepeatMemberInArray ($ array ){
// Obtain the array for removing duplicate data
$ Unique_arr = array_unique ($ array );
// Obtain
We encountered the following problem when dealing with the deletion of specific characters at both ends of the string. Let's look at the example first.
$ Str = 'akmumu/writedb. json ';What I want to do is to delete the starting akmumu and then
Addition
Copy codeThe Code is as follows: function jiafa ($ a, $ B)
{
For ($ I = 0; $ I {
$ A ++;
}
Return $;
}
// Echo jiafa (4, 2 );
SubtractionCopy codeThe Code is as follows: function jianfa ($ a, $ B){$ C = 0;While ($ B! = $){$ B ++;$ C
/* PHP Regular Expression extraction Any attribute in the image img mark */$ Str = ' PHP Regular Expression extraction or image change img any attribute in the tag ';
// 1. Retrieve the entire image codePreg_match ('/] *? Src \ s * = \ s * (\ '| \
First, create a conn. php file to connect to the database.
Copy codeThe Code is as follows: $ Link = mysql_connect ("mysql_host", "mysql_user", "mysql_password") or die ("cocould not connect:". mysql_error ());
Mysql_query ("set names utf8 ");
Mysql_
Strip_tagsRemove HTML and PHP tags.
Syntax: string strip_tags (string str );
Return Value: String
Correspondence type: Data Processing
Description
This function removes any HTML and PHP tag strings contained in the string. If the HTML and PHP
Method 1 (tested) has built-in php_curl.dll. In the ext directory, This DLL is used to support SSL and zlib.In php. ini, find extension = php_curl.dll and remove the preceding comment.Set extension_dir = c: \ php \ ext. When the PHP page is
Copy codeThe Code is as follows: // -- Call method/demo. php? Url = http://v.youku.com/v_show/id_XMzkyODA2NTEy.html
Echo getYoukuFlv ($ _ GET ['url']);
Function getYoukuFlv ($ url ){Preg_match ("# id _(.*?) \. Html # ", $ url, $ out );$ Id = $ out [
1. memory overflow SolutionDuring data statistical analysis, large arrays are often encountered, and memory overflow may occur. Here is my solution. The problem is illustrated in the following example:Assume that the number of records in the log is 5
Data structure is very important, algorithm + Data Structure + document = Program
Describes the Bubble Sorting Algorithm Using PHP. The object can be an array.
Copy codeThe Code is as follows:
// Bubble sort (array sorting)Function bubble_sort ($
When learning java, you will know that there are multiple examples in the design mode:
1. Multiple instance types can have multiple instances2. You must be able to create and manage your own instances and provide your own instances to the outside
_ FILE _ indicates that the absolute path of the current FILE includes the FILE name, dirname (_ FILE _) indicates the absolute path of the current FILE, and basename (_ FILE __) indicates the name of the current FILE, dirname (_ FILE __). "/f /".
PHP 4 introduces the foreach structure, which is similar to Perl and other languages. This is just a simple way to traverse arrays. Foreach can only be used for arrays. An error occurs when you try to use it for another data type or an uninitialized
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