我收到成千上萬的錯誤日誌,看起來像這樣:FEOF()預計參數1是資源
$xml = "<requisicao-boleto>
<website>
<n_website>{$n_website}</n_website>
<password>{$password}</password>
</website>
<sacado>
<name>{$name}</name>
{$user_code}
<address>
<street>{$street}</street>
<complement>{$complement}</complement>
<number>{$number}</number>
<district>{$district}</district>
<state_province>{$state_province}</state_province>
<city>{$city}</city>
<postcode>{$postcode}</postcode>
<country>{$country}</country>
</address>
</sacado>
<dados_boleto>
<product>{$product}</product>
<reference>{$uid}</reference>
<value>{$value}</value>
</dados_boleto>
</requisicao-boleto>";
$xml = preg_replace('/\s(?=\s)/', '', $xml);
$xml = "xml=" . $xml;
$n = strlen($xml);
$opts = array(
'http' => array(
'method' => "POST",
'header' => "User-Agent: My Own Http Client\r\n" .
"Content-length: " . $n . "\r\n",
'content' => $xml
)
);
$context = stream_context_create($opts);
$handle = fopen($URL, 'r', false, $context);
$conteudo = '';
while (!feof($handle)) {
$conteudo .= fread($handle, 1024);
}
的代碼是:
while (!feof($handle)) {
$conteudo .= fread($handle, 1024);
}
已經通過呈三角問題,任何人,知道如何克服這個問題?
我已經用完整的代碼更新了這個問題,同時我嘗試執行已經給出的th消耗。
$ handel有什麼? –
$ handle = fopen($ URL,'r',false,$ context); @ChetanAmeta – danrodrigues
所以你的fopen()失敗了 –