php -f index.php hello test 2314

shell命令执行php文件不像http那样通过GET方式传参

同样php文件获取的时候也不能用$_GET方法了

而是通过$argv[]方法

$argv[0]表示文件名。例如index.php

$argv[1]表示第一个参数,例如 hello

$argv[2]表示第二个参数,例如 test

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2021-04-20
  • 2021-08-10
相关资源
相似解决方案