Example 1
The code is as follows
Copy Code
badword.src.phpThe contents are as follows$badword =array (' John ', ' Toyota ');PHP FilterRequire (' badword.src.php ');$badword 1 = array_combine ($badword, Array_fill
Method One, filter some useless content
Filtering useless information is more rigorous, useful may also input not to go in, can look for other filtering methods on the Internet:
The code is as follows
Copy Code
function
Cases
The code is as follows
Copy Code
Header ("Content-type:text/html;charset=utf-8");function Getrandpass ($length = 6) {$password = ';Add the characters you want to the string below, the default is the number 0-9 and
December 2016 31, SaturdayFirst, open the XAMPP, create a folder under Htdocs for PHP to create the database:650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8C/44/wKioL1hnwBGhh7uhAAM5hYResrE707.png-wh_500x0-wm_3 -wmp_4-s_995447636.png
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_fill (index,number,value);Role:Populating an arrayParameters:Index: Array start position int typeNumber: Amount of data to populate int typeValue: The values of the arrayreturn value:The populated arrayExample: adding two parameters to ' dog '
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
Array_change_key_case--Returns an array with string key names all lowercase or uppercaseArray_chunk--Splitting an array into multipleArray_combine-Creates an array with the value of an array as its key name, and the value of another array as its
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
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
PHP policy mode and php policy Mode
Policy mode: defines a series of algorithms, encapsulates each algorithm, and enables them to replace each other. This mode allows algorithms to change independently of customers who use it. The rule mode
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