We all know the importance of databases for the network. due to the complexity of cgi, asp and php + MySQL have become the mainstream. almost all personal webpages use message books, but the requested message books are unstable. this has caused a
Php application performance optimization
The biggest advantage of using PHP programming is that it is very easy to learn this programming language and its rich library. Even if we don't know much about the functions we need, we can guess how to
Note that the Iterator is better abstract than the object set, because we can make InfiniteIterators, NoRewindIterators, and so on without having to be consistent with the regular array. Therefore, Iterator lacks functions such as the count ()
/*** Replace the image in fckedit with the domain name* @ Param string $ content to be replaced* @ Param string $ the domain name to be added to the image in the strUrl content* @ Return string* @ Eg*/Function replacePicUrl ($ content = null, $
Echo date ("Y-m-d H: I: s"); // current time?>
The difference between the time obtained by this method and the standard time is 8 hours;
From php5.1.0, the date. timezone option is added to php. ini, Which is disabled by default.
That is, the
I encountered two small php problems in my company. I will close them up so that we can solve them in the future.Sleep (10); if it is not placed in the for loop, it will continue to be executed below the process, rather than waiting.
Mb_strlen (val,
Some categories and products need to be added during magento development and template debugging. It is very troublesome when the website is officially launched, so I wrote a php file myself, used to clear products and categories
Enter check
Generally, it is a PHP. ini configuration problem. Set it again based on the following configuration items, and then restart the server. Try again!
(1) set the extension path
Find the row in extension_dir
; Extension_dir = "./"
Add a line
#1 do not like Unity? Switch to Ubuntu gnome classic Desktop
Log out of the unity desktop environment and select "classic desktop" as the logon environment.What if you like Unity, but your graphics card is not supported by 3D? Install Unity-2D:Sudo
Cannot find-lltdl. An error occurred while compiling php.The "usr bin ld cannot find lltdl" error occurs in php make. The detailed error is as follows:/Usr/bin/ld: cannot find-lltdlCollect2: ld returned 1 exit statusMake: *** [libphp5.la] Error
Using the PHP cURL library, you can easily and effectively capture webpages. You only need to run a script, analyze the web page you crawled, and then you can get the data you want as a program. Whether you want to retrieve part of the data from a
Function checkfile ($ file, $ cachetime = 60)
{
$ File = ROOT_PATH. '/data/cache/'. $ file. '. php ';
If (is_file ($ file ))
{
// If the file is modified (right-click the file attribute, There Is A: modification time) + cache time 60
// Use php to find the relative path of the two filesFunction compara_path ($ path_a, $ path_ B ){// Cut path.$ Array_a = explode ('/', $ path_a );$ Array_ B = explode ('/', $ path_ B );// Delete the last object from the array, and the rest is the
Time functions:
Strftime format local time/date according to region settings
Strptime-parse the date/time generated by strftime ()
Setlocale function sets region information (region information)
Date_default_timezone_set if you find that
This code can print the number of random lines in the text. For example, if one text contains 1 million lines, I need to randomly retrieve 500 lines.
1. $ file = "txt ";
2. $ data = file_get_contents ($ file );
3. $ arr = explode ("\ n", $
When installing php (fastcgi mode), you often have the following command:/usr/local/webserver/php/bin/phpize
I. What does phpize do?
What is phpize? Official php instructions:
Http://php.net/manual/en/install.pecl.phpize.php
Phpize is used to
// Automatically generate a random user name for the user (Length: 6-13)
Function create_password ($ pw_length = 4 ){
$ Randpwd = '';
For ($ I = 0; $ I
$ Randpwd. = chr (mt_rand (33,126 ));
}
Return $ randpwd;
}
Function generate_username ($
The default tag parser of thinkphp is in Lib/Template/TagLib/TagLibCx. class.
It defines common thinkphp tags such as volist php.
Here, I add a label resolution in this class.
Label format:
Tag function:
Loop output column where the parent
Sara Golemon wrote an article saying: "Is there a special place to find the GLOBALS array ?" The answer is "exist", that is, the EG (symbol_table)-Executor Globals structure. She also provided the specific instance for finding, as shown
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