How do I get the contents directly ?
Code: Select all
<pre>
<?php
ob_start(); # Need to get rid of this
require_once('nusoap/lib/nusoap.php');
$google_key = 'google_api_key';
$wsdl_url = 'http://api.google.com/GoogleSearch.wsdl';
$q = "some search term";
$parameters = array(
'key' => $google_key,
'q' => $q,
'start' => 0,
'maxResults' => 3,
'filter' => FALSE,
'restrict' => '',
'safeSearch' => FALSE,
'lr' => 'lang_en',
'ie' => '',
'oe' => ''
);
$soap_client = new soapclient($wsdl_url, 'wsdl');
$results = $soap_client->call('doGoogleSearch', $parameters);
print_r($results);
$contents = ob_get_clean(); # Need to get rid of this
print_r($contents); # Need to get this same $contents without the use of buffer
?>