Installing PHP using the Yum install directly in CentOS is a relatively low version, if you need a higher version, see the following:
Step 1:installing Remi Repository
# # Install Remi & Epel Repository on Rhel/centos 6.4-6.0-32 Bit # # RPM-UVH
PHP Classic Pagination Code class This is a PHP page code is a classic can automatically determine the URL parameters and then pagination of the instance code, while the last page, next page, home, last Oh, but also support the Select drop-down box
Declaring a final class math
Class math{
Const PI = 3.14;
Public Function __tostring () {
Return "This is the math class. ";
}
Here is a method for calculating the area of the circle. Const constants are used,
Note The method used, similar to the
2. Call Mb_internal_encoding ("GBK")
?
str = ' I am a long string of Chinese-www.jefflei.com ';
echo "MB_SUBSTR:". Mb_substr ($str, 0, 6, ' utf-8′);
“;
MB_SUBSTR: I'm a bunch of
PHP altogether gave four versions, VC9 x86 Non thread safe, VC9 x86 thread safe, VC6 x86 Non thread safe, VC6 x86 thread safe, which makes me this rookie headache ah, fortunately, PHP website provides Download the place on the left there is an
Realization of the article
In general, use the PHP tutorial to implement the upload progress bar in the following two ways:
1.APC Extension (author is the founder of PHP tutorial, after 5.2 PHP has joined APC extension)
2.PECL Expansion Module
In PHP fsockopen function can imitate the user to visit some Web site and can also bring some common information, if the browser, Ip,post,get and so on data, I will introduce each of you.
If you want to use the Fsockopen function we must set the
PHP Tutorial Configuration in the Upload_tmp_dir this parameter to compare, if the file is under this directory, then Move_uploaded_file will be moved operation. And this comparison is case sensitive,/under Windows is not the same. And in the PHP
RSS subscription function, in many sites can have but there are many, the following code is their own writing, which used to a PHP class: RSS.class.php, feel very convenient, dare not exclusive, special take out to share with you.
The
P> no hate GBK Unicode UTF8 Kanji Conversion
PHP's conversion of Chinese characters has always been a rather troublesome thing.
The class contains four filters "[dec];", "& #x [hex];", "%u[hex]", "UTF8 conversion"
User-friendly and customizable
The following is a PHP cache file implementation class, according to my experience, the cache file is based on the user set time and the file generated during the day and the current time to compare, and then determine whether you need to regenerate
Two PHP Ajax file upload code This two Ajax file upload code is actually using the JS iframe or Ajax post to implement the following to see the code bar.
Two PHP tutorial ajax file Upload codeThese two Ajax file upload code is actually using the JS
With Pear::benchmark, you now know how to test your code, how to determine if your code is fast or slow, and which part is slower. So what I'm going to say next is how to eliminate or optimize that part of the slow code.
This point on my personal
PHP File online Compression program class to provide a super perfect PHP file online compression program, the principle is very simple is to put the file in binary form, the previous use of RAR kernel program, which is PHP's own compression function.
//
Function: Get the remote picture and save it locally
//
//
Make sure you have permission to write files to the local server
//
//
Variable Description:
$url is the full URL address of the remote picture and cannot be empty.
$filename is an
Upload the file HTML input tag in the name of the filename to add [], the role is to create an array in HTML to PHP, such as name pictures, multi-file reference name is pictures[], the example is as follows:
The code is as follows
$message =
<>
...... Piles of strings such as bulk HTML code can be read
EOD;
Loaded into the $message.
$to = "digico@123.com";
$mail = "hts@123.com";
$zhuti = "I love You"; Letter Subject
$mailheaders. = "content-type=text/html;charset=gb2312";
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