admin 发表于 2023-2-16 18:54:55

PHP执行运算符

<div id="article_content" class="article_content clearfix">
      <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
      <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
                <div id="content_views" class="htmledit_views">
                  <p>PHP中支持执行运算符&#xff1a;反引号&#xff08;&#96;&#96;&#xff09;注意这不是单引号&#xff01;PHP 将尝试将反引号中的内容作为 shell 命令来执行&#xff0c;并将其输出信息返回&#xff08;即&#xff0c;可以赋给一个变量而不是简单地丢弃到标准输出&#xff09;。使用反引号运算符“&#96;”的效果与函数 <ahref="https://www.php.net/manual/zh/function.shell-exec.php">shell_exec()</a> 相同。</p>
<pre><code><?php
$output &#61; &#96;ls -al&#96;;
echo &#34;<pre>$output</pre>&#34;;
?></code></pre>
<p>PHP执行shell命令来完成对系统的操作 使用函数shell_excel</p>
<pre><code>shell_exec(string $cmd): string</code></pre>
<p></p>
<p></p>
                </div>
      </div>
      <div id="treeSkill"></div>
页: [1]
查看完整版本: PHP执行运算符