Objective
PHP Chinese garbled is one of the common problems in PHP development, Chinese garbled now like sometimes occurs in the Web page itself, some of the production is in the process of MySQL interaction, and sometimes related to the operating
The data in the session in PHP is stored on disk by default in the form of files, which may be sufficient for small sites. Big event for large and medium-sized websites, or some have special needs of the site, the default storage method has not been
If you increase the speed of page loading, how to optimize is a problem, Yahoo has made an optimization of 36. In fact, the method of Web optimization is still a lot of many. Here's how to reduce the page volume to improve front-end loading
1
2//Example use of getenv ()
3 $ip = getenv (' remote_addr ');
4//or simply use a superglobal ($_server or $_env)
5 $ip = $_server[' remote_addr ');
6?>
This is the method provided in the official PHP manual.
However, when the Web Server API is
PHP's unique syntax mixes C, Java, Perl, and PHP's self-innovative syntax. It can perform dynamic Web pages more quickly than CGI or Perl. Dynamic pages made with PHP are embedded in HTML documents to execute, compared to other programming languages,
As XML continues to heat up, PHP provides a large number of standard libraries (class libraries) dedicated to XML to manipulate XML. For example, the rewriting of DOM XML extensions, SimpleXML extensions, SOAP extensions, and PHP5.1 XMLReader and
Description
• Non-standard WebService, which can only be accessed by PHP
• Standard WebService, it is necessary to use the WSDL
Here I only introduce the standard WebService www.2cto.com
First, create WSDL
1. Download SoapDiscovery.class.php class
Today we are looking at a problem, it is not a problem to extract content from a string with a regular, to repeatedly check strings and regular expressions. Also wrote a small script test, no problem, back to the code debugging, and failed.
Strings
The use of PHP DOM function to achieve a simple one-page information crawl (here to crawl a tag, the function is implemented, but the extension page link crawl did not implement, welcome to criticize the guidance)
Error_reporting (E_error);
$pages =
Here is a summary of several character functions in PHP, a summary:
1) Ucfirst
Capitalize the first letter, such as
$string = "This is my web development blog";
echo Ucfirst ($string);
Output:this is my web development blog
2) Lcfirst, lower
A Introduction to JSON
JSON (JavaScript Object Notation) is a lightweight data interchange format. Easy for people to read and write. It is also easy for machine parsing and generation. JSON takes a completely language-independent text format, but
1. For foreach in fact the $key=> $value and $i = $g is the same effect, and is not limited to key value
echo "\ n ";
$arr = Array ("One", "one", "three");
foreach ($arr as $i = = $g) {
echo "Key: $i; Value: $g\ n ";
}
?>
2. Array_fill ()
As we all know, reduce the size of the code in the transmission, you can improve the transmission speed of the page, open the Web page is also fast, this is based on the theory of bandwidth bottlenecks, of course, the server speed is affected by
1, the generation mechanism of the session in PHP
Let's start by analyzing how a session is generated in PHP. The purpose of the session is to maintain the various states of each user to compensate for the lack of HTTP protocol (stateless). We now
This article will be the discussion of the PHP5 of the object copy Technology original article please respect copyright error or inappropriate also want to be able to point out
The origin of object replication
Why do objects have the concept of
For images uploaded on the front-end of a Web site, it is necessary to scale them in the background to produce a uniform size thumbnail image. In PHP, it is convenient to use the GD library to accomplish this task. The following static method of the
These days in testing our current PHP framework found that the framework layer loading PHP files for a long time, the final discovery is because a variety of require_once causes the entire load time to become longer, if you do not use Eaccelerator,
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