2011-11-07 3 views

답변

2

file_get_contents을 사용할 수 있습니다. 반환 값에 따라 성공했는지 확인할 수 있습니다 (실패시 false, 성공한 데이터). 또한 경고를 억제하기 때문에 같은 @를 사용할 수 있습니다

if($data = @file_get_contents($filename)) ... 

마지막으로, file_get_contents이 SimpleXMLElement 개체를 만들 반환 된 데이터를 사용하는 대신 simplexml_load_file의 simplexml_load_string를 사용합니다.

관련 문제