For example:
echo `whoami`;
// Export the database, the folder to be imported must have writable permissions, and the content after -u -p must be written immediately
Copy code The code is as follows: echo `mysqldump -h localhost -u$DbUser -p$DbPwd --default-character-set=utf8 $DbName > /var/$dumpFileName`;
Other uses of backticks
<?php #使用反撇号,暗示作为命令来执行 $result=`date`; echo "<p>the server timestamp is: $result</p>"; echo "<hr color=red>"; #使用shell_exec() $result1=shell_exec("date"); echo "<p>the server timestamp is: $result1</p>"; ?>
The output results are as follows:
the server timestamp is: Current date: 2009/06/30 Enter the new date: (year, month, day)
The above is the entire content of this article, I hope you all like it.