curl_exec supress output

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

curl_exec supress output

Post 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?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: curl_exec supress output

Post by requinix »

There's something here that can help you. The option is in the first, "value should be a bool", section.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: curl_exec supress output

Post by klevis miho »

Yeah I found it, I should add:

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

thnx man
Post Reply