In the site landing and registration, often used to verify the code to prevent other people with mechanical violence registration or landing, plus the verification code to a certain extent to make the site a lot of security, the following is a
Recently bored nothing to do, began to do some of the sharing of PHP, the code is relatively simple, but more practical.
This is written four years ago, a few lines of code to achieve four-bit random number of PHP verification code function.
Array_search (value, array, bool);Role:Finds the existence of an array by value, returns the keyParameters:Value: values that need to be looked upArray: ArraysBool:false DefaultTrue when set to True to match the type and value of valuesreturn
Array_key_exists (Key,array);Role:Whether there is a key in array arraysReturn:BOOL exists return True, there is no return falseExample: whether the name exists in the array$arr = Array (' name ' = = ' char ', ' age ' = +, ' sex ' = ' f '); if
Note: Try not to manipulate the database in the loop.1. Two one-dimensional arrays merged into one one-dimensional array$a = Array (' Morning ', ' afternoon ', ' Night ');$b = Array (' Breakfast ', ' lunch ', ' dinner ');(1) The array element in $ A
Sharing and email sharing
Share the development experience of a php client. Sometimes, when a project or project needs to be shared and then perform a series of events, we need to get the share action, that is to say, we already know that this item
The most detailed PHP environment is manually built under win7: apache2.4.23 + php7.0.11, win7apache2.4.23
Download resources (apache24, php7, phpStorm9)
Modify the apache24 configuration file
Install and start
Dynamic Verification Code settings on the login page, dynamic verification code on the pageDynamic Verification Code settings on the logon page
Use the idea of creating an object in php to set a dynamic verification code1. Create a background image
Easy-to-understand big picture carousel, you can do it as well...
big picture carousel > class =" ad "> class =" ad "> var rightBtn = document. getElementById ("right-btn"); var leftBtn = document. getElementById ("left-btn"); var n = 1;/
Query and intercept thinkphp data
public function NewsList(){ $this->assign('title','news'); $p = I('page',1); $listRows = 6; $News = M('news'); $info =
Small DOM exercises, data movement between two tables, dom tables
This article describes how to move data between two tables. The table on the left is moved to the right, and the table on the left disappears.
Micro-disk transaction website development, platform construction micro-transaction system source code, website development and Transaction System
New background image managementPricePackage 1: source code + setup + name and LOGO modification =
Sorting Algorithm-directly insert sorting, directly insert Sorting Algorithm
Direct insertion of sorting is to insert a record into an ordered table that has already been sorted, so as to obtain a new ordered table with the number of records plus 1.
Infinitus classification does not require Recursive Generation of multi-dimensional arrays (trees ).
A practical problem recently encountered in the project: the background product classification uses the infinitus method (1 ),
(Figure 1)
Now, the
Infinitus classification (1) Get the tree structure and the infinite Classification Tree Structure
Data Table Structure
Function:
Function make_tree ($ list, $ pk = 'id', $ pid = 'pid', $ child = '_ child', $ root = 0 ){$ Tree = array ();$
[Reprint] PHP PSR-1 basic code specification (Chinese version ),Basic code specification
This article provides standards for the basic elements of the Code to ensure that the shared PHP code has a high degree of technical interconnectivity.
Key
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