Which method to detect run mode of php script is more reliable?

后端 未结 2 1468
醉梦人生
醉梦人生 2021-01-24 19:38

I now to ways to detect weather php script runs in cli or web server mode:

if (defined(\'STDIN\'))

or:

if (isset($argc))
         


        
2条回答
提交回复
热议问题