내가 php
와 함께 XML
파일을 읽고 JSON
파일로 인쇄하기 위해 노력하고있어,하지만 난 다음 오류 받고 있어요 :XML 파일을 읽을 수 없습니다. (file_get_contents 스트림을 열지 못했습니다 : 연결 시간이 초과)
Warning: file_get_contents(http://193.190.76.149:81/ParkoParkings/states.php): failed to open stream: Connection timed out in /customers/2/9/e/viktordebock.be/httpd.www/parca/index.php on line 7 false
xml
내가 구문 분석하려고 해요 파일은 다음과 같습니다
(http://193.190.76.149:81/ParkoParkings/states.php)
, 모든 것이 잘 작동합니다.
첫 번째 URL이 IP 주소이기 때문에 그게 맞습니까?
<?php
function Parse ($url) {
$fileContents = file_get_contents($url);
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = simplexml_load_string($fileContents);
$json = json_encode($simpleXml);
return $json;
}
print Parse("http://193.190.76.149:81/ParkoParkings/states.php");
?>
작품 벌금을 나를 위해! 파일 상단에 오류보고를하고 오류를 알려주십시오! (' php에 \t \t 위해서는 ini_set ("display_errors를", 1); \t \t는 error_reporting (E_ALL); \t?>') 단지가 잘 작동을 참조하십시오 http://codepad.viper-7.com/aKkHPk – Rizier123
코드를 다른 호스팅에 업로드했는데 결국 작동합니다. 내 코드를 테스트 해 주셔서 감사합니다! –
그래서 문제가 해결 되었습니까? (대답했다) – Rizier123