Detecting whether or not to support Gzip is the use of the Function_exists function to determine your PHP environment support Ob_gzhandler No, if supported on the supporters gzip.
I wrote a function.
The code is as follows
Copy
Direct judgment in a program
Basic error handling: Using the Die () functionThe first example shows a simple script that opens a text file:
The code is as follows
Copy Code
$file =fopen ("Welcome.txt", "R");?>
We need to understand first.Chinese Double-byte character encoding range
1. GBK (gb2312/gb18030)X00-xff GBK Two-byte coding rangex20-x7f ASCIIXa1-xff Chinese gb2312X80-xff Chinese GBK
2. UTF-8 (Unicode)
U4e00-u9fa5 (Chinese)x3130-x318f (KoreanXAC0
PHP class library PHP QR Code
# Two words to explain:# contains qrlib.php words need to be put together with other files: files, folders.# phpqrcode.php is a merged version that only needs to contain this file, but the resulting image is slow and
Upload image Form Submit target to a hidden iframe,
The code is as follows
Copy Code
Form action= "upload.php" id= "Form1" Name= "Form1" enctype= "Multipart/form-data" method= "post" target= "Uploadiframe" >
1. Set Cookies
1. PHP Cookies
A cookie is a mechanism for storing data on a remote browser side to track and identify the user.PHP sends cookies in the HTTP protocol header, so the Setcookie () function must be output to the browser in other
If you need to update the cookie so that it stores the new value, simply overwrite its original value. So, even if you've just sent a cookie to the previous page, you can still change your name to "Jeff."*/
The code is as follows
Another is the pseudo static approach, where users and search engines see the static page of the. html suffix, but in fact it is still a dynamic program, but it is disguised in some way.
There are two ways to implement this approach:
The first is
The code is as follows
Copy Code
News headlines: the title already exists title cannot be empty cannot be empty
The code is as follows
Copy Code
PHP code
The code is as
PHP Tutorials Ajax examples and Ajax tutorials1 Create the XMLHttpRequest object's web effects program.2 a JavaScript program that emits asynchronous requests.3 JavaScript program that handles server responses.
*/
1 JavaScript program to create
Give a select form an element of no name.Submit the form after submission in $_post or $_get mode$_post[' sel '] or $_get[' sel ' to get the value of the selected select
if ($_post){echo $_post[' select '];}?>select drop-down list box China Web
Many of the dynamic network design involves the operation of the database, but sometimes it is necessary to switch to other background database, it requires a lot of modification procedures. This is a tedious, time-consuming and error-prone work. In
Prompt when opening the browserWarning: include (/global. php) [function. include]: failed to open stream: Permission denied in \ index. php on line 21Warning: include () [function. include]: Failed opening '/global. php 'for declaration
Recently used in the interface code json_encode, on the Internet to find that json_encode is set to UTF-8 Chinese will not garbled, verified this method is indeed effective, but do not know why, the code won't work after a while. The following is
The steps to integrate the operation code into ecshop are as follows:Add a function at the bottom of cls_template.php:/*** Process formulas in math. **/ Function get_math_para ($ val ){ $ Pa = $ this-> str_trim ($ val ); Foreach ($ pa AS $ value)
How to use the php language in the template file template of phpcms? There are two methods: one is the tag provided by phpcms, and the other is to directly write native php statements.1. Labels provided by phpcms{Php $ I = 10 ;}{Php $ I ++ ;}{Php
In fact, you don't need to look for the WordPress function. PHP itself provides some system variables to get the URL of the current page through integration.Function wpjam_get_current_page_url () {$ ssl = (! Empty ($ _ SERVER ['https']) & $ _ SERVER
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