downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

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&#039;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">&lt;?php<br />$output&nbsp;</span><span style="color: #007700">=&nbsp;`</span><span style="color: #DD0000">ls&nbsp;-al</span><span style="color: #007700">`;<br />echo&nbsp;</span><span style="color: #DD0000">"&lt;pre&gt;</span><span style="color: #0000BB">$output</span><span style="color: #DD0000">&lt;/pre&gt;"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</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(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites