The array is the soul of PHP, very powerful, but sometimes object-oriented programming is also very convenient, the array and the switch between the object is often the case:
Example One
The code is as follows
Copy Code
The basic flow of red envelopes in PHP: When the amount of red envelopes and the total amount of input, PHP will be based on these two values to randomly allocate each amount, to ensure that everyone can receive a red envelope, and the amount of
Super simple PHP picture statistics, this kind of statistical device I used to do with TXT file, now directly with the database to achieve it. Let's look at the data structure first.
CREATE TABLE ' Count ' (' ID ' int (a) not NULL auto_increment,'
Dichotomy (Dichotomie) is the method of splitting in two. Set the closed range [A,b] to R. The successive binary method is to create the following interval sequence ([an,bn]): A0=a,b0=b, and for either natural number n,[an+1,bn+1] or equal to [AN,CN]
Public Function decodefilter (HTML, filter)
Html=lcase (HTML)
Filter=split (Filter, ",")
For all I in filter
Select case I
Case "Script" removes all client script javascipt,vbscript,jscript,js,vbs,event,...
html = Exere
This article is mainly for the small dishes, if you are already a veteran, maybe some things will feel more boring, but as long as you look carefully, you will find a lot of interesting things oh.
To read this you just have to understand that this
The code is as follows
Copy Code
/***************************** Get all the files in the directory* [$dir] Folder path****************************/function Deepscandir ($dir) {$FILEARR = Array ();$DIRARR = Array ();$dir = RTrim
When you need to convert some data from utf8, cp1251 (window-1251) or cp1251 to utf8 you must use the system function iconv. Common host service providers do not allow this feature.*/Function cp1251_to_utf8 ($ s ){$ C209 = chr (209); $ c208 = chr (20
Incorrect php date reading time$ DateTime = date ("Y-m-d H: I: s ");Echo $ DateTime;Why is the printed date inconsistent with the system time on my server. I tested it locally.Configure php. iniYou can also set it to GMT in php. ini:Open php. ini to
Php curl_init function usageFirst, in php. ini in C \ windows, I opened the extension = php_curl.dll function, and then restarted apapche. The following is what I wrote to capture PHP information in Baidu:// Initialize curl$ Ch = curl_init () or die
PHP is quickly promoted with ease of use, but it is not easy to say that it can be used. In fact, many programmers use it to easily establish a WEB application system, but how many people have carefully considered their code, whether it is easy to
Introduction:The inclusion path in PERL and PHP has always been a hard problem to solve. It is mainly related to the operating system and WEB server. It is impossible to solve this path problem intelligently. Compared with PERL, PHP has a much
// It's really boring. It's a strange idea. I want to re-use PHP to implement some encapsulated functions in PHP,// The following code mainly implements some string processing functions in PHP, and implements some PHP// None, but the same function
Abs: obtain the absolute value.Acos: returns the arc cosine.Ada_afetch: gets the back column of the database.Ada_autocommit: Enables or disables automatic changes.Ada_close: close the Adabas D link.Ada_commit: change the Adabas D
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