file_get_content用于动态XML / API文件URL

时间:2017-01-09 13:02:38

标签: php xml

我正在尝试使用具有不同变量的动态XML文件显示结果。

我需要它从我当前的PHP页面获取特定内容并显示与其相关的结果。

我有这个:

<?php
$xml = str_replace("\n","&#10;", $xml);
$myListings = file_get_contents("http://api.domain.org/restaurants/nearby?key=abcdefghijklmnopq&state=TX&zip=<?php echo htmlentities($l->zip)?>&limit=2");
print_r("{$myListings}");
?>

<?php echo htmlentities($l->zip)?>

位用于从当前页面上的内容中提取邮政编码。但它似乎没有用。

有什么想法吗?

0 个答案:

没有答案
相关问题