pass crontab a variable and read it from PHP?

后端 未结 4 2035
无人共我
无人共我 2021-01-05 01:22

I have created a crontab rule:

* * * * * php /my/directory/file.php

I want to pass a variable to be used in the file.php from this crontab.

4条回答
  •  走了就别回头了
    2021-01-05 01:47

    May I add to the $argv answers that for more sophisticated command-line parameters handling you might want to use getopt() : http://www.php.net/manual/en/function.getopt.php

提交回复
热议问题