In the learning Phpmysql-character encoding (i), the conversion relationship between Unicode and UTF-8 is introduced, a UTF-8 coding rule is summed up, according to this coding rule, write a UTF-8 coding parser, the following is the implementation
Copy Code code as follows:
Class Ctbclass {
var $file;
var $index;
Create a file and write input
function Null_write ($new)
{
$f =fopen ($this->file, "w");
Flock ($f, LOCK_EX);
Fputs ($f, $new);
Fclose ($f);
}
Add data log to
In PHP, the Preg_match () function is a common function used to execute regular expressions. Regular expressions are used in almost all programming languages, and this example introduces the application of the Preg_match function of the PHP positive
MD5 () encryption algorithm
Mode: One-way encryption
Syntax: MD5 (string $str [, bool $raw _output = false])
$STR: Raw String
$raw _output: If the optional raw_output is set to TRUE, MD5 Digest will return in its original binary format in
PHP variable reference and variable destruction mechanism
In PHP, the symbol "&" denotes a reference.
1, to see if the situation is not quoted this way:
$a = "Hello world";//define a variable, the following assignment to $b
$b = $a;//This
The difference between static and normal variables in PHP
Adding static to the front of a variable constitutes a statically variable
The difference between a static variable and a normal variable is that the scope of a non-static global variable
This article is divided into three parts for everyone to introduce, the specific contents are as follows
1, micro-credit users, micro-trust server and background server interaction
Example: A micro-credit user sends a text message to the public
This article is mainly about the use of PHP functions pathinfo() , parse_url() and basename() parse the URL of the instance code, the following words do not say more directly to see the code
The instance code is as follows:
1, using PathInfo to
I have to follow the following two steps to resolve, and finally in the 2nd step in the FastCGI timeout time increased to 300, the problem is resolved:
PS: More envy of the Thunder Web server, 16G memory.
1, see the current number of PHP fastcgi
A small program that uses PHP to open the socket port directly for a letterThe feature is the use of SMTP authentication, can better use to meet the needs of general users to build stations.
The entire source code attached to this article, the same
I often use the Oso forum, personal feeling is very good, so imitate the interface of Oso compiled a program, share with everyone.
Program consists of three parts, that is, display the theme information, display forum information, add forum
you do not need to display the declaration variable in PHP, and the variable declaration can be performed concurrently with the assignment.
Good programming habits: all variables should be declared before use, preferably with annotations.the
This article summarizes the PHP practical code fragment. Share to everyone for your reference, specific as follows:
A keyword extraction from the Web page
$meta = get_meta_tags (' http://www.jb51.net/');
$keywords = $meta [' keywords
This article illustrates the use of a Gaussian algorithm in PHP to implement the fuzzy processing function of the image. Share to everyone for your reference, specific as follows:
image_create_from_ext ($SRCIMG);
$SRCIMGOBJ = $this->blur ($
These days in doing a picture upload function, originally wanted to upload images with Ajax to achieve instant refresh, but has not been achieved, alas.
It was later implemented using an IFRAME framework, however, there is a problem with this
PHP Request remote Address set timeout, mainly explained file_get_contents, fopen, curl These three simple commonly used functions to set the time-out time method, generally recommended to use curl, the best performance, efficiency is the highest.
1
Translator Note: This article is formerly known as "Creating a multi-file Upload Script in PHP." I think this article is generally written, the code is not very professional, but it is relatively short, and a time can not find a better article, the
If you want to put binary data, such as picture files and HTML files, directly stored in your MySQL database, then this article is written for you! I'll show you how to store these files through an HTML form, and how to access and use them.
This
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