Backtick operator in PHP

by Nirmala 2010-04-07 12:39:26

Backtick Operator
Backtick operator is also called as Execution Operator.
These are not a single-quotes. PHP will attempt to execute the contents of the backticks as a shell command.
In PHP to execute a shell command use this backtick operator.
Example:
<?php
$output = `ls -al`; //treated as a backtick operator not a single quotes
echo "
$output
";
?>

Tagged in:

1234
like
0
dislike
0
mail
flag

You must LOGIN to add comments