当前位置:网站首页>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 .
边栏推荐
- 3D laser slam: Interpretation of logo-loam paper --- Abstract
- C语言:优化后的希尔排序
- What are the software tuning methods? Let's see what Feiteng technology experts say about dragon lizard technology
- Harbor正确密码登录不上去
- Stored procedures and functions
- "Basic knowledge of PHP" implement mathematical operations in PHP
- Why do major domestic manufacturers regard cloud computing as a pastry? Do you really understand this trillion market
- 1024 | in the fourth year officially called Menon, the original intention is still there, and continue to move forward
- Dormitory access control system made by imitating the boss (III)
- [resolved] SSO forwarding succeeded, and there was an unexpected error (type=internal server error, status=500) caused by parameters in the forwarding URL
猜你喜欢

软件调优方法有哪些?看看飞腾技术专家怎么说 | 龙蜥技术

如何更新pip3?和Running pip as the ‘root‘ user can result in broken permissions and conflicting behaviour

Notes in "PHP Basics" PHP

擎创科技加入龙蜥社区,共建智能运维平台新生态

Qt Creator代码风格插件Beautifier

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

"PHP Basics" PHP statements and statement blocks

Leetcode54. Spiral matrix

"PHP Basics" tags in PHP

How to log in multiple wechat on the computer
随机推荐
Harbor正确密码登录不上去
vCenter7.0管理Esxi7.0主机
mqtt指令收发请求订阅
Internet of things industrial UART serial port to WiFi to wired network port to Ethernet Gateway WiFi module selection
Happy holidays, everyone
I can't figure out why MySQL uses b+ trees for indexing?
C语言:优化后的希尔排序
The third letter to the little sister of the test | Oracle stored procedure knowledge sharing and test instructions
How does kettle handle text data transfer as' 'instead of null
Things come to conform, the future is not welcome, at that time is not miscellaneous, neither love
增强:BTE流程简介
Convert objects to key value pairs
Development of three database general SQL code based on PG Oracle and MySQL
Combined use of C WinForm form form event and delegate
Mqtt instruction send receive request subscription
Promise details
Local Oracle reported ora-12514: tns: the listener cannot recognize the requested service at present
数据库启动报error_user_connect_times &gt; 0错误
How to obtain the cash flow data of advertising services to help analyze the advertising effect?
关于数据库的接口响应非常慢