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
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
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
The following PHP code resolves the following issues:
1.json_encode UTF8 code in Chinese after the string is not readable
The problem of Chinese garbled 2.json_encode in multi-series group
The 3.json_encode array contains a newline error
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
VLD IntroductionVLD is a php extension of pecl (PHP extension and application repository), and now the latest version is 0.14.0(2016-12-18), which is to display the internal representation of the dump PHP script (opcode) ( Introduction to VLD from
PHP configuration background login and template introduction, php background template Introduction
(1) The project. env is the file for configuring the
Php uses curl to call interface methods, get and post, and curl.
The first is the client execution method ApiModel. php:
$ v) {$ o. = "$ k = ". urlencode ($ v ). "&" ;}$ post_data = substr ($ o, 0,-1); $ key = md5 (base64_encode ($ post_data); if ($
PHP shared development details, php shared details
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
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