Source of: /manual/en/language.operators.execution.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/language.operators.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'language.operators.execution.php',
1 => 'Execution Operators',
),
'up' =>
array (
0 => 'language.operators.php',
1 => 'Operators',
),
'prev' =>
array (
0 => 'language.operators.errorcontrol.php',
1 => 'Error Control Operators',
),
'next' =>
array (
0 => 'language.operators.increment.php',
1 => 'Incrementing/Decrementing Operators',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<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.php" class="function">shell_exec()</a>.
</p><div class="informalexample">
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br />$output </span><span style="color: #007700">= `</span><span style="color: #DD0000">ls -al</span><span style="color: #007700">`;<br />echo </span><span style="color: #DD0000">"<pre></span><span style="color: #0000BB">$output</span><span style="color: #DD0000"></pre>"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div><p>
</p>
<blockquote><p><b class="note">Note</b>:
The backtick operator is disabled when <a href="ini.sect.safe-mode.php#ini.safe-mode" class="link">safe mode</a> is enabled
or <a href="function.shell-exec.php" class="function">shell_exec()</a> is disabled.
<br />
</p></blockquote>
<p class="para">
See also the manual section on <a href="ref.exec.php" class="link">Program
Execution functions</a>, <a href="function.popen.php" class="function">popen()</a>
<a href="function.proc-open.php" class="function">proc_open()</a>, and
<a href="features.commandline.php" class="link">Using PHP from the
commandline</a>.
</p>
</div><?php manual_footer(); ?>