What are the backticks `` called?

在评估其内容的过程中调用了哪些反引号操作符(``)?


If you're referring to bash then the backticks are known as "command substitution". $() provides similar functionality.


Backticks (``) is an Execution Operator. PHP will attempt to execute the contents of the backticks as a shell command; the output will be returned (ie, it won't simply be dumped to output; it can be assigned to a variable). Use of the backtick operator is identical to shell_exec() .

Eg.

<?php
$output = `ls -la`;
echo "<pre>$output</pre>";
?>

For more info refer: http://php.net/manual/en/language.operators.execution.php


In Perl, the backtick operator has a synonym: qx//. The q and x stand for "quote & execute." You'll see it referred to as 'command' too, but frankly, in the Perl community and throughout most of the Perl documentation, they're just called the backtick operator or backticks. Calling them anything other than backticks or the backtick operator in the context of a Perl program will simply make it harder to know what one is talking about.

链接地址: http://www.djcxy.com/p/1846.html

上一篇: 这个符号在PHP中的含义<?=

下一篇: “叫什么反引号?