Instance 291: create a new PHP5.0 string. Instance 291: create a new PHP5.0 string this is a string created instance location: CD mingrisoft10291 instance description previous string definition method is to use single quotes string
Instance 291: create a new PHP 5.0 string
This is an instance created by a string.
Instance location: CD mingrisoft10291
Instance description
In the past, strings were created using single quotation marks or double quotation marks. in versions later than PHP 5.0, a new string definition method was introduced, this example describes how to create a new string.
Run this instance, as shown in Figure 10.29. if "Jilin province tomorrow technology" is printed on the page, the new string is successfully created.
|
0.29 create a new PHP 5.0 string |
Technical points
The key technology of this instance is how to create this new string. This string starts with "<" and is followed by the string. In this example, "mark" is used as the mark and is followed by the string content, end with a mark ("mark. The new string format is as follows:
<
<标记
String content // equivalent to "string content"
Mark;
|
Implementation process
(1) create a new PHP 5.0 string. The code is as follows:
$ Str = <
Jilin Tomorrow Technology
Strmark;
Echo $ str;
?>
|
(2) run the instance. if "Jilin province tomorrow technology" is displayed in the browser, the program is successfully created.
Let alone
Based on this instance, you can:
Use a new string to create a mail header and body.
The HTML tag is used as the string content and output without escaping.
Listen 5.0 New string this is a string created instance location: CD mingrisoft10291 instance description previous string definition method is to put the string in single quotes...