Curl automatically display the result?

Posted by Emily on Stack Overflow See other posts from Stack Overflow or by Emily
Published on 2010-04-08T00:28:28Z Indexed on 2010/04/08 0:33 UTC
Read the original article Hit count: 299

Filed under:
|

I'm using php 5.3.2 and when i execute a curl it display the result directly without adding a print or echo function.

Here is my code:

<?php
$pvars = array('query' => 'ice age', 'orderby' => 'popularity');
$timeout = 30;
$myurl = "http://www.website.com";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $myurl);
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars);
$xml = curl_exec($curl);
curl_close ($curl);
?>

What's wrong with my code and why it displays the result?

© Stack Overflow or respective owner

Related posts about php

Related posts about curl