Today we will introduce you to the specific methods for PHP to obtain the function of the current url. Through understanding this function method, we will further deepen our understanding of the PHP language, improve Our learning level.
The PHP 5.0
Copy codeThe Code is as follows:Define (CHARSET, 'utf-8'); // default system Encoding/*** Trim strings based on Chinese Characters* @ Param $ string-string* @ Param $ length-length* @ Param $ doc-thumbnail suffix* @ Return returns the string with
Smarty is a very popular template system. It separates business and logic, and runs fast. It is widely used in php websites.
However, a problem occurs when deploying it to sina app engine (sae). Because sae cannot perform file read/write operations
A. use echo and other PHP native output methods to output data on the pageB. output through the display MethodYou can use the assign Method to allocate variables.C. Modify the Left and Right delimitersDo not modify the configuration items in the
Background: A high school girl in Beijing asked me to help her become a "technical consultant" for her practical training. The practical training required me to develop a web project independently. The development language she chose was php. In fact,
There are many character string operations in PHP, including the following:
(1) echo, print, printf, sprintfThe first two functions are output strings. If there is a variable name in the string, it is replaced with its value.The last two functions
Source: http://www.pchoer.com/
PHP implements five basic operations on Text Databases: data display, addition, modification, deletion, and query.I used a message Book Program as an example to illustrate how PHP can display, add, modify, delete, and
5.2 Initialization
Try to initialize the local variable while declaring it. The only reason for not doing so is that the initial value of the variable depends on some previous calculations.
5.3 Layout
Declare variables only at the beginning of
7.2 Spaces
Spaces should be used in the following cases:-A keyword followed by parentheses should be separated by spaces, for example:While (true ){...}Note: spaces should not be placed between the method name and the left parenthesis. This will
3. Regular Expression DefinitionA regular expression (regular expression) describes a string matching pattern, it can be used to check whether a string contains a seed string, replace matched substrings, or retrieve substrings that meet certain
5. All symbolic interpretations
Character
Description
Mark the next character as a special character, a literal character, or a backward reference, or an octal escape character. For example, n matches the character "n ".
PHP and COM
If you are an adventure and you are running PHP on a Windows System Using CGI, ISAPI, or Apache, you can also obtain the COM function of the system. Now, the work of interpreting COM (the Component Object Model of Microsoft) is left to
For pages that require authentication, it is best to use the apache server for authentication.However, the interface for apache server authentication is not user-friendly. Besides, not all situationsYou can use the apache server for verification,
Tofu is made of excellent productsHttp://www.asp888.net bean curd technology station
Calendar is often used in some Web projects that we often need. It is troublesome to write such scripts, and the functions are not powerful enough.A powerful
Php Chinese string truncation} the above method can be used to prevent garbled characters.
Php Chinese string truncation
Code:
/*** String truncation * @ param $ string the string to be intercepted * @ param $ length the length of the int
We can see that the results are in the format of objects and arrays, so that we can easily obtain the values of each element in XML.
Php uses simplexml to parse xml
The code is as follows:
$xml =
http://www.php230.com/
I recommended an open-source flash Avatar Upload component two days ago. today I added this component to the codeigniter framework. The biggest feature of this component is ease of use. of course, if you want to modify some of the features, you may
The CodeIngniter framework has its own paging class, but it finds a problem during use, that is, when the current page number is negative, it will cause paging display exceptions. The following code controls that the current page number does not
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