📄 language.operators.execution.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Execution Operators</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.operators.errorcontrol.html">Error Control Operators</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.operators.increment.html">Incrementing/Decrementing Operators</a></div> <div class="up"><a href="language.operators.html">Operators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="language.operators.execution" class="sect1"> <h2 class="title">Execution Operators</h2> <p class="para"> PHP supports one execution operator: backticks (``). Note that these are not single-quotes! PHP will attempt to execute the contents of the backticks as a shell command; the output will be returned (i.e., it won't simply be dumped to output; it can be assigned to a variable). Use of the backtick operator is identical to <a href="function.shell-exec.html" class="function">shell_exec()</a>. <div class="informalexample"> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$output </span><span style="color: #007700">= `</span><span style="color: #0000BB">ls -al</span><span style="color: #007700">`;<br />echo </span><span style="color: #DD0000">"<pre>$output</pre>"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> <blockquote><p><b class="note">Note</b>: The backtick operator is disabled when <a href="features.safe-mode.html#ini.safe-mode" class="link">safe mode</a> is enabled or <a href="function.shell-exec.html" class="function">shell_exec()</a> is disabled. <br /> </p></blockquote> <p class="para"> See also the manual section on <a href="ref.exec.html" class="link">Program Execution functions</a>, <a href="function.popen.html" class="function">popen()</a> <a href="function.proc-open.html" class="function">proc_open()</a>, and <a href="features.commandline.html" class="link">Using PHP from the commandline</a>. </p> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="language.operators.errorcontrol.html">Error Control Operators</a></div> <div class="next" style="text-align: right; float: right;"><a href="language.operators.increment.html">Incrementing/Decrementing Operators</a></div> <div class="up"><a href="language.operators.html">Operators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -