linux下curl get方法传递参数

 

例如 

url 为 http://mywebsite.com/index.php?a=1&b=2&c=3

web形式下访问url地址,使用$_GET是可以获取到所有的参数

然而在linux下

curl http://mywebsite.com/index.php?a=1&b=2&c=3

$_GET只能获取到参数a

由于url中有&,其他参数获取不到,在linux系统中& 会使进程系统后台运行

必须对&进行下转义才能$_GET获取到所有参数

curl http://mywebsite.com/index.php?a=1\&b=2\&c=3

 

posted @ 2018-08-02 14:38  MokeyChan  阅读(30351)  评论(0编辑  收藏  举报