In php development, we need to include a file. The common code is as follows:
Copy codeThe Code is as follows:If (is_file ($ fileName ))Require $ flleName;
In windows and linux, there is no question: Assume that a d:/web/webServer/A. php file must
PHP:
1. Use the unset () method:Copy codeThe Code is as follows:$ A = array ("red", "green", "blue", "yellow ");Count ($ a); // get 4Unset ($ a [1]); // deletes the second element.Count ($ a); // get 3Echo $ a [2]; // The array contains only three
1. isset function: determines whether a variable is initialized.
Note: It does not determine whether the variable is null and can be used to determine whether the elements in the array have been defined.Note: When isset is used to determine whether
Get an xml object:Copy codeThe Code is as follows:$ Resp = $ this-> c-> execute ($ req, $ sessionKey); // obtain the xml Object$ Items = $ resp-> items;To read the object value, use $ items-> item, or $ items-> item-> price. This operation is
When the key name is a number or an abnormal variable character (if there is a space), you must use obj [xx] to obtain the value.Copy codeThe Code is as follows:
// Declare json data$ Array = array ('result' => array ("90" => "90 queue", "status" =>
Recently, you need to use the mail sending function, which was originally sent using the mail () function provided by PHP. Php mail () is a simple, convenient, and easy-to-use method. However, in addition to Netease mailbox, QQ mailbox, GMAIL
The parse_url () function is available on the PHP official website. The result is similar to the parse_url () function, which is implemented using regular expressions. URI is the type of resources available on the Web-HTML documents, images, video
Some of my friends may encounter some problems: When uploading files, if the original name is good in English, there will be no problems. If it is Chinese, garbled characters may occur, today, I will summarize the causes and solutions for garbled
Copy codeThe Code is as follows:Mixed preg_replace (mixed $ pattern, mixed $ replacement, mixed $ subject [, int $ limit =-1 [, int & $ count])It is a function used to execute a regular expression to search for and replace the regular expression.
Programmers who have developed PHP should be clear that PHP has many built-in functions and can master them to help you better develop PHP, this article will share eight essential PHP functions, all of which are very practical and I hope all PHP
1. access the main file to access this page. This page sets the return status header ('HTTP/123') for this file based on the return results of the "verification page '. $ code. ''. $ _ status [$ code])Copy codeThe Code is as follows:Ini_set ('max _
Scroll screen to load more data, suitable for comments and other pagesThe database in this example is simple and clear at first glance. Copy codeThe Code is as follows:$ Query = mysql_query ("select * from content order by id desc limit 0, 10
The page flip file loads all the content at a time, so it is not very suitable for large websites, but suitable for scenarios with less data.In this example, no database is used. PHP CodeCopy codeThe Code is as follows: JavaScript
14. Architecture page (BatimentBuildingPage. php)
Now I am going to parse the real building page. There are a lot of functions in it, but it is not difficult. Let's take a look at it.
First, check the space used by the planet and update it. Use the
When we use thinkphp for development, sometimes we use the getById ('1') method to quickly obtain a piece of information. This method is better than where ("id = 1 ") -> find () is much easier to use, and the query efficiency is faster than find.
The problem code is as follows:
query('select top 10 * from f_city'); dump($test); */ $CityModel = M('city'); $CityModel->find(); dump($CityModel); } } ?>
The problem is that the query can be used to correctly read the data,
Destoon users always exit automatically when using the 360 browser. After investigation, it is found that the cookie is lost, but the reasons for the loss are different!The solution is also different. The test finds that the modification of the 360
The ThinkPHP template engine provides a wide range of comparison labels. The usage format is as follows:
content
The comparison labels supported by ThinkPHP and their meanings are as follows:
Eq or equal: equalNeq or notequal: not equalGt:
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