Reputation: 25
I'm trying to pass a variable into shell_exec, I've looked at other tutorials but they still dont help.
I want to pass $var[1] into the shell_exec so it will just display this specific file or directory's information
$output = shell_exec('ls -l'.$var[1]);
Upvotes: 0
Views: 374
Reputation: 73211
You should add some whitespace:
$output = shell_exec('ls -l '.$var[1]);
// ^here
Upvotes: 1