Reputation: 1900
I have two php files.
first one execute the second one I want to send a params with the exec
I have no idea how to get the params i sent in the second file
first.php:
$params="hello";
shell_exec('php file.php $params > /dev/null 2>/dev/null &')
file.php:
echo $params;
Thanks!
Upvotes: 1
Views: 246
Reputation: 32323
Try echo $argv[1]
Take a look at this page from the documentation
Upvotes: 0
Reputation: 683
$argv
contains any arguments passed to the script.
See http://php.net/manual/en/reserved.variables.argv.php
Upvotes: 0