Answer the question
In order to leave comments, you need to log in
How to pass parameters to shell_exec php?
Interested in the question, how to pass parameters through shell_exec? For example:
shell_exec('php /var/www/html/script.php test test2');
Answer the question
In order to leave comments, you need to log in
$arg1 = escapeshellarg('test');
$arg2 = escapeshellarg('test2');
shell_exec('php /var/www/html/script.php "' . $arg1 .'" "' . $arg1 .'"');
var_export($argv); // Содержит массив переданных аргументов
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question