simplexml error handling php

前端 未结 7 1404
失恋的感觉
失恋的感觉 2020-11-27 19:50

I am using the following code:

function GetTwitterAvatar($username){
$xml = simplexml_load_file(\"http://twitter.com/users/\".$username.\".xml\");
$imgurl =          


        
7条回答
  •  Happy的楠姐
    2020-11-27 20:40

    if (simplexml_load_file($file) !== false) { // continue } else { echo 'Error!'; }

    And Twitter is down, maybe ?

提交回复
热议问题