php - 无法从 php 中的 xml 加载数据
问题描述
XML 在我的本地主机中按预期工作,但是当我尝试从在线服务器加载数据时,它无法加载。
XML ->xml feed
代码
<?php
$xmldata = simplexml_load_file("xml feed") or die("Failed to load your file");
foreach($xmldata->children() as $empl) {
$offering_type = $empl->offering_type;
$reference_number = $empl->reference_number;
$price = $empl->price;
$price = (int)$price;
$city = $empl->city;
<------- html code here to display the xml data ---->
?>
它未能加载 xml 提要并返回“未能加载您的文件”
谢谢
解决方案
问题出在托管服务器上。启用 File_Open=on 后。我可以访问数据。
推荐阅读
- docker - 在 docker-compose 中启用组件?
- php - PHP pdo_dblib 扩展通过 HTTP 工作,但不能通过 CLI
- react-native - pod install cdn_source.rb:342:in `download_file_async': URI:Module 的未定义方法`encode'
- c++ - 如何分配和释放函数指针数组并让 valgrind 满意?
- python - 在 Python 中反转组/项目
- html - 需要在 Wordpress Bakery 中使用 CSS 更改图像大小
- css - CSS 变换动画会导致后续模糊元素出现视觉故障(仅限 Chrome)
- python - Django模型字段默认=无用?
- ios - 如何使用 GRDB 在 iOS 上查询具有 1-1 关联的表?
- powershell - 使用 powershell Get-Content 和 Set-Content 编辑文本文件时遇到问题