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.
|
Figure 10.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.