tags:

views:

78

answers:

1

I have the following php code:

exec('curl -X POST http://mysite.com', $output =array());

The return string my http://mysite.com is not displayed on the shell, but the following string is displayed:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     3    0     3    0     0     19      0 --:--:-- --:--:-- --:--:--     0

I don't want anything to display on the shell. How to I disable priting to the shell when using exec() command. There are other commands?

+3  A: 

Use curl's silent option: -s

exec('curl -s http://us.php.net/manual/en/function.ob-clean.php', $output);
akellehe
I don't think the OP's question is about PHP's error messages. It's about getting CURL's output but without the transfer info.
Pekka
shouldn't clearing the output buffer take care of that?
akellehe
it doesn't, nevermind.
akellehe
the silent option doesn't work?
akellehe
Thanks the silent options works
Cory
Removing downvote, this looks like something that works
Pekka
hooray :)......
akellehe