This example demonstrates how PHP can manipulate XML. The message book has the following basic functions: 1. message display page
2. publish messages and allow uploading images
3. enter the password to log on and delete the message.
1. file
Just a few days ago, I also wrote a process lock class, which is more advanced than the one mentioned in the above article. 1. read and write locks are distinguished.
If a write lock is used each time, multiple processes will be queued to read one
The previous article has learned how to use Ajax and PHP to read data from the database, so that you can dynamically obtain the latest data from the database. This article continues to introduce writing data to the database through forms. When it
Programming in windows: When the session_start () method is used, session_start () [function. session-start]: Cannotsendsessioncachelimiter-headersalreadysent, this is also the case. later, if you put this php file in linux and open it, you will
When I recently wrote a php class, I always encountered the functionnonobject error. I knew that the class was not instantiated, but I did not know where the error was. Definition and usage
The _ construct () function creates a new SimpleXMLElement
The page number on the left of the current page is the latest product, which is listed in ascending order by update time. the page number on the right is the previous product, which is sorted in descending order by update time. If the number of
Provides an implementation method for file security in php multi-threaded context. This implementation does not use the filelock mechanism of php and uses the temporary file mechanism. Each thread in multiple threads writes a temporary file to each
Php promise classification (recursion) implementation code. For more information, see.
The code is as follows:
$ Conn = mysql_connect ("localhost", "root", "myoa888 ");Mysql_select_db ("lost63", $ conn) or die ("select db error ");$ SQL [] =
Function: (a) delete a file (B) edit a file, and delete a folder on a webpage (c), provided that the folder is empty (d) create a file or folder, modify folder name
The code is as follows:
/*Function: (a) delete a file (B) edit a file, and
After the in command is executed, the function is the same as setautocommit0, and it is invalid when setautocommit0 or 1 is set later. Therefore, in order to make the operation clear, do not use BEGIN. Mysql_query ("BEGIN"); // starts a transaction.
Php processes millions of databases and how to improve query processing speed 1. to optimize queries, we should try to avoid full table scanning. First, we should consider creating an index on the columns involved in where and order.
2. try to avoid
Sometimes we need to check whether there are parameters in the URL link, and then determine whether to add them as needed? Adding & amp; at the end is just a small trick, but it is useful for paging or page jump. For example, because some links
Determines whether the string is within the specified length.
The code is as follows:
//----------------------------// Function name: CheckLengthBetween ($ C_char, $ I _len1, $ I _len2 = 100)// For usage: determines whether the string is
Before encode, convert it to utf-8. After decode, convert it back to gbk:
The code is as follows:
Function tb_json_encode ($ value, $ options = 0){Return json_encode (tb_json_convert_encoding ($ value, "GBK", "UTF-8 ″));}Function tb_json_decode ($
We can see that microtime (true) is used in other people's source code. we checked the manual and added this parameter from PHP5.0.0. This function has been used for obtaining:
The code is as follows:
Function microtime_float (){List ($ usec, $
The UnknownModifier error occurs during PHP regular expressions. the solution is as follows:
$ A = '2
Tóngd ~ng
Optional 3 ';Echo preg_replace ('/[^
Will prompt:
Warning: preg_replace (): Unknown modifier 'P'
Deleting multiple records at a time is very troublesome if you do not have the batch deletion function for more information. This makes it much easier. A simple example
There is an existing student information database, and multiple records need to
Kang Sheng's authcode function can be said to have made significant contributions to the Chinese PHP community. Including Kangsheng's own products, and most Chinese companies that use PHP use this function for encryption. authcode uses exclusive or
PHP Cache data is very advantageous for faster and better function running. If a file is tested multiple times in the script, you may not cache the correct results. To achieve this, you can use the clearstatcache () function.
Definition and usage
Use PHP to filter the code that may be used in html to introduce external dangerous content. Sometimes, users must submit html content to enrich the information published by users. of course, some codes that may cause messy page layout are also
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