Heim  >  Artikel  >  Backend-Entwicklung  >  php中的``运算符是干什么用的

php中的``运算符是干什么用的

WBOY
WBOYOriginal
2016-08-04 09:21:052037Durchsuche

php中的``运算符是干什么用的

回复内容:

php中的``运算符是干什么用的

上面内容就是垃圾翻译的代表
shell作为专业术语 直接用, 不应该翻译成外壳, 增加误解...


``里内容作为shell命令来执行

就举上面例子

<code><?php $a =`ls -al`;
var_dump($a);
</code></code>

运行了就能显示当前文件夹内容了

请阅读 PHP 官方文档,比看书有用。最好看在线的。新手我都这么统一建议。

你这个问题对应的文档地址 http://php.net/manual/zh/language.operators.execution.php

所有你需要的,都有。例子也很清晰。例子不清晰的,往往下面的用户评论中也会有很清晰的示例(用户发出的示例大多是英文,其他的基本上都翻译了的)

执行shell_exec命令,高危函数,建议关掉
参考:http://www.yunxi365.cn/index.php/archives/10/

`` 与 shell_exec() 功能相同;

<code>可以运行linux命令.并返回输出;</code>

是一个高危函数!

<code>Shell:
pidstat -p `pidof firefox`</code>

PHP也可以像Shell那样很方便地用反撇号`或者shell_exec等调用系统命令.
MySQL中,当数据库名/表名/字段名和保留字(关键字)冲突时,在SQL语句里用反撇号(`)括起来区分开.

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn