This paper simply analyzes the implementation method of PHP simple interlaced color changing function. Share to everyone public reference. Specific as follows:
$color = ""; echo "Interlaced color effect:"; echo ""; for ($i =1; $i
I hope this
PHP Search Array Strings We typically use Array_search and In_array two functions
array_search() function in_array() , look for a key value in the array. If the value is found, the key name of the matching element is returned. Returns False if it
/*
array_filter () filters cells in an array with a callback function
Array_filter (array,function)
parameter Description: If the custom filter function returns True, the current value of the array being manipulated is included in the returned
1, if the method of the class can be defined as static, as far as possible to define as static, it will increase the speed of nearly 4 times times.
2,
row[i-d ] is 7 times times the speed
of Row[id].
3. Echo is faster than print
Note: The article described below is the model
Use app\models\article;
The DD () function in this article, for my own custom function
function dd ($var) { echo '"; Var_dump ($var); echo ""; Die;}
1: Prevent SQL injection, using the
If the request is sent directly to the back end of the synchronization process, the resource for a process is occupied (such as Apache's Prefork mode) from the time the request is received to the response being sent out. In the case of slow
Reason:
php5.5 later preg_replace no longer supports the E-mode modifier, which can be replaced with the Preg_replace_callback function.
Workaround:
Locate the file Smarty_Compiler.class.php line No. 270:
/* replace special blocks by "{php}"
Verifying a string is the most common feature in a program. For example, if you meet a scenario, verify that the string conforms to the IP address format. There are usually two ways of doing this:
(1) Handwriting an IP address check function
(2)
HTML > Head > charset= "Utf-8">title>
title >
head>body >
php $con = mysqli_connect ("localhost", "root", "root", "EHR"); if (! $con) { //transcoding echo ' Could not
PHP from the start to the abandonment series -01.php environment of the building
First, why to learn PHP
1, PHP language for the rapid development of small and medium-sized websites;
2, and has a very mature open-source framework, such as
Before you know this function, look at another function: __autoload.
First, __autoload
This is an auto-load function, which is triggered when we instantiate an undefined class in PHP5. Look at the following example:
printit.class.php
Location Matching command
~ #波浪线表示执行一个正则匹配, Case sensitive~* #表示执行一个正则匹配, Case insensitive^~ #^~ represents normal character matching, and if this option matches, matches only that option, and does not match the other options, typically used to
1. Subclasses cannot access parent class private properties and methods
2. Overloading of methods is not supported
data. ""; }} Class Childa extends _parent{}class childb extends _parent{ protected $data = "childb";//overrides the parent class'
/** * shows a time equivalent to the current time in seconds before, how many minutes ago, how many hours ago, if more than 1 years, to directly display the exact time * * @param int $inputTimestamp Unixti Mestamp * @param string $overflowTimeFormat
Scenario of high Performance PHP log
High Performance PHP log scheme
The log is completed in two steps:
Log information is written to the memory cache in real time to minimize performance overhead
Crontab periodically collects writes
Ajax The advantages of the application are :
1. Improved user experience through asynchronous mode
2. Optimize the transfer between browser and server, reduce unnecessary data round-trip, reduce the bandwidth consumption
3. The Ajax engine
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