PHP provides three ways for sesion storage: File/memory/custom storage, using file storage by default. This is not a good way to go on a Web site with a large volume of traffic, because it can result in a lot of redundancy in the input and
The simplest PHP statement imports the database *.sql file into the database
Copy Code code as follows:
$sql =file_get_contents ("Text.sql"); Read the SQL statement as a string into the $sql
$a =explode (";", $sql); Use the explode ()
In general, when we use CURL to submit POST data, we are accustomed to writing this:
Copy Code code as follows:
curl_setopt ($ch, Curlopt_postfields, $post _data);
But this kind of writing in some cases will not be very useful, may
Today in the 64-bit red Hat Enterprise Linux as Release 4.7 Compile PHP5.2.6 error, MySQL is used by the RPM method installed, PHP compiled code as follows:
The basic principle of OB: If the OB cache is turned on, the Echo data is first placed in the OB cache. If header information is placed directly in the program cache. When the page executes to the end, the OB-cached data is put into the program
In the use of PHP to do things when found a problem, can be simply summed up as a garbled problem, but the problem is not the function itself. To see who the culprit is.
Suspect: Base64_encode and Base64_decode
Crime: I wrote a jump and prompt
There are several commonly used asynchronous file upload functions, such as the use of the IFRAME frame form, Ajax function effect, as well as the flash+php function, the following describes the Ajax and iframe asynchronous file upload function
Many PHP developers know that using the static member function of a class is more efficient than the normal member function of a class, this article analyzes this problem from the application level
Here is an example:
Copy Code code as
REMOTE_ADDR can only obtain IP settings that are set in the visitor's local connection, such as 10 of its own on a university campus network. X.xxx. XXX Series IP, and this function to get the IP address of the LAN gateway exit, if the visitor uses
When we write data to MySQL, for example:
Copy Code code as follows:
mysql_query ("Update table set ' title ' = ' Kuhanzhu ' blog '");
That's going to go wrong. As with ASP, the database is allergic to single quotes. And
The HTTP protocol is a stateless protocol, which means that every request you make to the site is independent and therefore cannot be saved by itself. But this simplicity is one of the reasons it has spread widely in the early days of the
The functionality that is documented in this article is similar to the order by in MySQL, where a requirement is encountered in the previous project.
Requirements: Get each of the 4 data from two different tables, then consolidate (Array_merge)
PHP is a server-side scripting language used to develop dynamic Web applications. No good server-side debugging tool is one of the limitations compared to Java. We usually add echo, var_dump, and so on in the PHP code to display the variable, the
Just contact to the problem, I did not take into account the iterator mode, tried a few general ideas, after the failure .... Directly to look at the source of the implementation of foreach, expect to find a foreach processing object when there is
Whether PHP, or other server-side scripts provide the file upload function, the implementation is relatively simple. and using JavaScript to match, you can achieve AJAX-style file upload. Although jquery itself does not provide such a simplified
The string compression method provided by PHP has
1.gzcompress-compress a string
This function compress the given string using the ZLIB data format.
2.gzencode-create a gzip compressed string
This function returns a compressed version of the
PHP's Array function In_array () is very convenient, but JS is not. In fact, I do not like the JS array ~
Stop it, go directly to the method
Copy Code code as follows:
Array.prototype.in_array = function (e)
{
for (i=0;i{
if
1, preparing elements
1 JS file to replace the font
JS Code:
function Com_stewartspeak_replacement () {/* Dynamic Heading Generator by Stewart Rosenberger Http://www.stewartspe Ak.com/headings/this script searches through a Web page for
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