【问题标题】:What does the grave accent symbol (`) ( not single quote) represent in PHP?PHP 中的重音符号 (`)(不是单引号)代表什么?
【发布时间】:2011-05-20 11:57:10
【问题描述】:

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

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

$return = `$cmd`

【问题讨论】:

  • 那不是重音,那是重音。尖锐的口音则相反。

标签: php


【解决方案1】:

它执行一个shell命令。所以它会执行 $cmd 中的任何内容。

backtick operator

【讨论】:

    【解决方案2】:

    shorthand 对应于 exec()。命令的输出可以直接用在表达式中。
    http://php.net/manual/en/language.operators.execution.php

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-17
      • 2011-12-13
      • 2012-06-05
      • 2021-04-26
      • 2023-01-11
      • 2011-03-27
      相关资源
      最近更新 更多