Home  >  Article  >  Backend Development  >  PHP uses a backtick (`, that is, the one under the ESC key on the keyboard, which is the same as ~) to execute external commands

PHP uses a backtick (`, that is, the one under the ESC key on the keyboard, which is the same as ~) to execute external commands

WBOY
WBOYOriginal
2016-08-08 09:26:081347browse

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

echo `mysqldump -h localhost -u$DbUser -p$DbPwd --default-character-set=utf8 $DbName > /var/$dumpFileName`;

The above introduces how PHP uses the backtick (`, which is the one under the ESC key on the keyboard, and it is the same as ~) to execute external commands, including some aspects. I hope it will be helpful to friends who are interested in PHP tutorials. .

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn