First, the file upload
1, client settings:
(1), in
Label Enctype and method two properties to indicate the corresponding values.
Enctype= "Multipart/form-data"; Method= "POST"
(2), form form to set up a hidden type of input box, where the value
We have to use Content-type:text/json to display the JSON data properly.
The code is as follows
Copy Code
Header (' Content-type:text/json '); This is the point, it tells the object receiving the data this page output is
Here are three ways to get the name of the file prefix a friend you need to refer to.
Method One:function Extend_1 ($file _name){$retval = "";$pt =strrpos ($file _name, ".");if ($pt) $retval =substr ($file _name, $pt +1, strlen ($file _name)-$pt)
To do time data conversion to timestamp we use the PHP tutorial with functions, the strtotime () function resolves the date-time description of any English text to a Unix timestamp
Format one Fri Aug 05 12:19:04 +0800 2011
Strtotime ("Fri Aug 05
Chart GalleryThe following class libraries make it easy to create complex diagrams and pictures. Of course, they need the support of the GD library.Pchart-a library in which you can create statistical charts.Libchart-This is also a simple
The number of times to execute the same code set is used in PHP. The basic syntax of the author is as follows:
The For loop is just a little bit more code, and loops are added to it. And one of the common tasks involved in the cycle is:
Sets the
Recently in the writing BBS, encountered code conversion problems. Looking for a long time, only to get a better solution, can completely restore the original text.Here is a post for you to correct me.System: linux+php4+oracle8i ?--title, name and
Date-format a local time/dateThe date/time function allows you to extract and format the date and time on the server.Note: these functions depend on the local settings of the server.InstallThe date/time function is a core component of PHP. These
SyntaxOpendir (path, context)*/$ D = dir ("c: windows"); // open the directory and assign the value to the variableEcho "handle:". $ d-> handle. "n"; // handel attribute of the output DirectoryEcho " ";Echo "path:". $ d-> path. "n"; // path
The in_array () function searches for the given value in the array.SyntaxIn_array (value, array, type)*/ The code is as follows:Copy code $ OS _list = array ("mac", "nt", "irix", "linux"); // defines an arrayIf (in_array ("irix", $ OS _list) //
"Fatal error: Call to undefined function" occurs when the program is running.Mb_convert_encoding () "fatal error. This problem is well solved:Open the extension = php_mbstring extension in php. ini.Restart apache.TestFor example:$ Content = iconv
Recently, when developing templates for wordpress, we found that path errors may occur when calling other php code snippets in the form of include ("file name. Previously, the server environment was always iis, and no similar bugs were found.
/*1. Set php. ini, find data. timezone = in php. ini, remove the; sign, and set data. timezone = "asia/shanghai.2. Through php page settings, we can add date_default_timezone_set ('Asia/Shanghai') to the php page ');Or ini_set ('date. timezone ',
Xmlhttp, no refreshing sound, no funnel mark, the best effect, but high requirements on the browser, fortunately, my application is only a subsidiary function, so users do not need to enable this control ...... Finally, we decided to adopt this
Static keywords are used to describe member attributes and member methods in a class. Where are the benefits of Static members? We previously declared that the "Person" human, in the "Person" class, if we add a property of "Person's country, in this
I recently bought php and mysql web development and saw the array loop statements. It is worth your attention and I will keep some handwriting for later reading.Generally, foreach uses more The code is as follows:Copy code $ Price = array
Foreach statementThe Foreach loop is introduced in php4.0 and can only be used as an array. In php5, object support is added. The syntax format of this statement is:Foreach (array_expression as $ value)Statement;Or The code is as follows:Copy code
Php Tutorial array sorting rsort arsort asort$ Full_name = array ();$ Full_name ["Roger"] = "Waters ";$ Full_name ["Richard"] = "Wright ";$ Full_name ["Nick"] = "Mason ";You may be the value in the array to be sorted. For example, assume that the
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