当前位置:网站首页>Use of "PHP Basics" delimiters
Use of "PHP Basics" delimiters
2022-07-27 08:10:00 【Go home at night】
Functional requirements
Use the delimiter to output a string , The string contains a variable , And the value of the variable . Delimiters are no different from double quotes , The included variables are also replaced with actual values .
The sample code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Use delimiters to define strings </title>
</head>
<body>
<?php
$i = ' Show the contents of this line ';
echo <<<std
This is no different from double quotation marks ,\$i It can also be output .<p>
\$i The content is :$i
std;
?>
</body>Running results
Functional requirements
PHP Support use JavaScript code . Save a segment by defining a string with a delimiter JavaScript Code , And dynamic output JavaScript Code .
The sample code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Use delimiters to output JavaScript sentence </title>
</head>
<body>
<?php
$str = <<<mark
<script language = "javascript" type = "text/javascript">
alert(" Welcome to PHP The world !!!");
</script>
mark;
echo $str;
?>
</body>Running results
Knowledge description
delimiter (<<<) from PHP4.0 Start supported . When used, it is followed by an identifier , Then there's the string , Finally, the same identifier ends the string . The format of the delimiter is as follows :
$string = <<<str
String content
str: among str Identifier specified for .
Be careful : The end identifier must be on a separate line , And spaces are not allowed . Errors will also occur if there are other matches or characters before and after the identifier .
边栏推荐
- Use of string type "PHP Basics"
- 物来顺应,未来不迎,当时不杂,既过不恋
- Lua有状态迭代器
- Solid smart contract development - 3.3-solid syntax control structure
- Hu related configuration
- "Basic knowledge of PHP" implement mathematical operations in PHP
- 存储过程与函数
- How to log in multiple wechat on the computer
- What are the software tuning methods? Let's see what Feiteng technology experts say about dragon lizard technology
- 2022/7/26 exam summary
猜你喜欢
![[resolved] SSO forwarding succeeded, and there was an unexpected error (type=internal server error, status=500) caused by parameters in the forwarding URL](/img/05/41f48160fa7895bc9e4f314ec570c5.png)
[resolved] SSO forwarding succeeded, and there was an unexpected error (type=internal server error, status=500) caused by parameters in the forwarding URL

2020国际机器翻译大赛:火山翻译力夺五项冠军

物联网工业级UART串口转WiFi转有线网口转以太网网关WiFi模块选型

如何获取广告服务流量变现数据,助力广告效果分析?
![[pytorch] resnet18, resnet20, resnet34, resnet50 network structure and Implementation](/img/44/52c7dc6871fd43223eadfd394e159e.png)
[pytorch] resnet18, resnet20, resnet34, resnet50 network structure and Implementation

The third letter to the little sister of the test | Oracle stored procedure knowledge sharing and test instructions

The seta 2020 international academic conference will be held soon. Welcome to attend!

Ubuntu: install PostgreSQL

"Intermediate and advanced test questions": what is the implementation principle of mvcc?

API 版本控制【 Eolink 翻译】
随机推荐
You may need an additional loader to handle the result of these loaders.
关于数据库的接口响应非常慢
Opengauss stopped from the library and found that the main library could not write data
Can Linux install sqlserver
C语言:随机生成数+插入排序
这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?
The third letter to the little sister of the test | Oracle stored procedure knowledge sharing and test instructions
Lua有状态迭代器
What is a rebound shell? What's the use of bouncing shells?
浅谈数据安全
Design and development of GUI programming for fixed-point one click query
综合案例、
kalibr标定realsenseD435i --多相机标定
"PHP Basics" tags in PHP
I can't figure out why MySQL uses b+ trees for indexing?
How to analyze and locate problems in 60 seconds?
ERP生产作业控制 华夏
Grandson's questions are difficult, and his son's invigilation is strict. I can't do it. Pay back my school money
Convert objects to key value pairs
Teach you to build a nail warning robot hand in hand