tags:

views:

263

answers:

2

When i use this code,

$ch = curl_init($url);
$statuses = curl_exec($ch);
curl_close($ch);

I am returned what i want, but if i just use that - $statuses is echoed out onto the page, how can i stop this?

+6  A: 

Put this on line 2:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
Matt McCormick
haha i found that just before you posted :)
tarnfeld
+2  A: 

Include this option before curl_exec()

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
Dominic Barnes