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


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

在下面的示例中,第二行中的重音是什么意思?

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

它执行一个 shell 命令。因此,它执行$cmd中的任何内容。

请参阅反引号运算符

它是exec()的简写。命令的输出可以直接在表达式中使用。
http://php.net/manual/en/language.operators.execution.php

(请注意,您仍然应该事先将escapeshellarg()应用于命令字符串中的变量。