Page 1 of 1

curl_exec supress output

Posted: Tue Jan 19, 2010 8:58 am
by klevis miho
This code:

Code: Select all

$ch = curl_init('http:yahoo.com');
curl_exec($ch); 
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Displays me:

Code: Select all

The document has moved here.

I want to not display anything, how can I make it?

Re: curl_exec supress output

Posted: Tue Jan 19, 2010 9:08 am
by requinix
There's something here that can help you. The option is in the first, "value should be a bool", section.

Re: curl_exec supress output

Posted: Tue Jan 19, 2010 9:09 am
by klevis miho
Yeah I found it, I should add:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
after the first line :)

thnx man