0
$ch = curl_init(); //this part we set up curl
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$xml_response = curl_exec($ch);
curl_close($ch);
header('Content-type: application/xml'); //specify as xml to not display as one long string
echo $xml_response;
//header('Content-type: text/plain'); //specify as xml to not display as one long string
$xml = new SimpleXMLElement($xml_response); //time to echo back the correct piece of data
$editorialReview = $xml->Items->Item->EditorialReviews->EditorialReview->Content;
ob_start();
echo '<p>Editorial review: '.html_entity_decode($editorialReview).'</p>'."\n";
$MineNow = ob_get_contents();
ob_end_clean();
var_dump($MineNow);
我想要做的是在回聲後我需要將它存儲到一個變量,所以我可以發佈 的數據到MySQL;我嘗試使用ob_start會話來捕獲它,但var_dump沒有返回任何值!回聲值和存儲爲變量
'var_dump'總是相呼應的東西,即使它是空字符串... –