Categories
Linux Server Administration Tips PHP Tips & Tutorials

PHP: Back tick `

Back tick ` in PHP is used to read the output from another program, usually external commands in Linux shell, much like the way a pipe does the job with bash.

In PHP, Backtick “ embraced string is treated a command and executed externally in shell, returning the execution results from the standard output. For example,

$files = `ls -l`

And $files now contain the files and directory listing by the bash command ‘ls -l’.

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Kavoir.com? Shoot me a message.

1 reply on “PHP: Back tick `”

Comments are closed.