博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助 

天堂あ飞翔

Things do not change; we change...
heavenflying.cublog.cn
关于作者  
     ^V^^V^^V^^V^^V^^V^
     LOVE MY GF FOREVER
     ^V^^V^^V^^V^^V^^V^

我的分类  




get the verbose http header with curl command
A new workmate asked me how to get the verbose http header with the curl command in debian3.1. I used the curl command several times but I never used it to get the verbose information about http header. I tried the curl command with the verbose option, but I couldn't see the verbose infomation. Then I redirected the standard error stream into the standard output stream and redirected the output stream into a file. Finally, It worked. The following example is my resolution.
<?php
$output = array();
exec("curl -v www.google.com > /tmp/output.curl 2>&1", $output, $ret);
$output2 = array();
exec("cat /tmp/output.curl",$output2,$ret2);
print_r($output2);
?>

 发表于: 2008-03-06,修改于: 2008-03-06 17:40
 已浏览428次,有评论0条
推荐 投诉

  网友评论

  发表评论



Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们
页面生成时间:0.01371

京ICP证041476号