I am currently debugging some code and I am getting an error of: ls: invalid option -- '/'. However if I try the value for $somePath in terminal it gives me the result. Why am I getting the error?
PHP:
exec('ls -A' . $somePath.' | grep .', $output);
Terminal Path:
ls -A /home/userName/public_html/path/folder