1) use tags to set page Encoding The role of this label is to declare the client browser with what character set encoding to display the page, xxx Can Be GB2312, GBK, UTF-8 (and MySQL is UTF8) and so on. Therefore, most pages can use this method to
The is_file () function checks whether the specified file name is a normal file.Is_file-Tells whether the filename is a regular fileUsageBool is_file (string $ filename) $ file is a required ParameterReturns TRUE if the object exists and is
Chart LibraryThe following class library allows you to easily create complex charts and images. Of course, they need the support of the GD library.PChart-A database that allows you to create statistical charts.Libchart-This is also a simple
Blog: WordPress
WordPress is a well-known blog platform developed using PHP. It is free, open-source, and powerful. It is not only used for blog building, but also widely used in various network information publishing platforms.
Forum: phpBB
PhpBB
After a day, I came up with an eye.For AJAX or Flash applications, submitting Chinese content to the background involves encoding and decoding (encode, decode) and conversion of encoding formats.We recommend that you do not use the escape function
Recently, I have seen a clever method. The principle is:$ Var_a = 'var _ B ';$ Var_a = 'test ';Echo $ var_ B; Is 'test'So we can handle it like thisCopy codeThe Code is as follows:Foreach (array ('_ cookies',' _ Post', '_ get') as $ _
In this way, we can use this function for many purposes, such as the token encrypted transmission and temporary password for Single Sign-On.Copy codeThe Code is as follows:/*** @ Param string $ string original text or ciphertext* @ Param string $
If you use file_get_contents directly, an error is returned;Copy codeThe Code is as follows:$ Url = (https://xxx.com ");File_get_contents ($ url ); Error:Warning: file_get_contents (https://xxx.com) [function. file-get-contents]: failed to open
In the future, you must remember to define the character type.Mysql_query ("set names 'gbk '")The solution is that simple.Today, we made a database query and released code.Copy codeThe Code is as follows:/*Filename: query. phpDo: get and show the
1. Upload the form upload.html Copy codeThe Code is as follows: 1. note this is a tag. to upload a file, you must specify it as multipart/form-data. Otherwise, the server will not know what to do.2.The Value is the hidden Value range of the form
Creating a progress bar with Ajax + php is actually very simple.ReadyState = status (0, 1, 2, 3, 4)0: the request has not been initialized and open has not been called.1: The request has been created, but has not been sent yet.2: The request has
The following are functions used to filter HTML code:Copy codeThe Code is as follows:Function ihtmlspecialchars ($ string ){If (is_array ($ string )){Foreach ($ string as $ key => $ val ){$ String [$ key] = ihtmlspecialchars ($ val );}} Else {$
1. String Representation In PHP, a string has three forms: single quotes, double quotation marks, and heredoc.The PHP manual recommends that you use single quotes strings whenever possible. To escape a variable, use a double quotation mark string.
The red part is my comment.For more information, see:1. Common features have been encapsulated. In the header file such as zen_API.h, you do not need to view internal details, which is a waste of time. (See Appendix A of Extending and Embedding PHP)2
RequireFor examplerequire("MyRequireFile.php");. This function is usually placed at the beginning of the PHP program. Before the PHP program is executed, it will first read the file specified by require to make it a part of the PHP program webpage.
CodeCopy codeThe Code is as follows:$ Url = 'www .baidu.com '; // capture BaiduEcho snapshot ($ url); // The output result is the image address.Echo snapshot ($ url, './baidu.png'); // Save the image to baibaidu.png, and the image size of the output
First, write a simple page capture function.Copy codeThe Code is as follows:Function GetSources ($ Url, $ User_Agent = '', $ Referer_Url ='') // capture a specified page{// $ Url: the Url of the page to be crawled// $ User_Agent the user_agent
The output control function does not affect the header information sent using header () or setcookie (). It only applies to data blocks similar to echo () and PHP code.Let's take a simple example to give you a general impression on Output
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