简体   繁体   English

在PHP中,重音符号(`)(不是单引号)代表什么?

[英]What does the grave accent symbol (`) ( not single quote) represent in PHP?

In the example below, what do the grave accents in the second line mean? 在下面的例子中,第二行中的重音符号是什么意思?

$cmd = "$ffmpeg -i $video -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg $image 2>&1";

$return = `$cmd`

It executes a shell command. 它执行shell命令。 So it executes whatever is in $cmd. 所以它执行$ cmd中的任何内容。

See backtick operator 请参见反引号运算符

It is a shorthand for exec() . 它是exec()简写 The output of the command can be directly used in an expression. 命令的输出可以直接在表达式中使用。
http://php.net/manual/en/language.operators.execution.php http://php.net/manual/en/language.operators.execution.php

(Please note that you still should apply escapeshellarg() to variables in the command string beforehand.) (请注意,您仍应事先将escapeshellarg()应用于命令字符串中的变量。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM