现在在用yahoo的api,那url有时好用有时不好用。现在fopen一failed,就全部用到那个相应variable的都error。
$url2 = "http://yahoo-url-here";
try {
$file2 = @
fopen($url2, "r");
} catch(exception $e){
die('error');
}
$i=0;
while (!feof($file2)) {
//code here
$i++
}
programming菜鸟,随便写个了try catch在那,没用。