php - 删除第一行并用php处理xml文件
问题描述
我在 xml 文件中有一个时间戳,我需要跳过第一行中存在的时间戳并使用 PHP 处理 xml 文件。下面是我的 XML 文件的示例。
2020-03-31T00:00:00-0500
<list>
<listing>
<ad_id>20624163</ad_id>
<date_created>01-Apr-18</date_created>
<price>$465,000</price>
</listing>
</list>
<list>
<listing>
<ad_id>20624657</ad_id>
<date_created>27-Apr-18</date_created>
<price>$446,000</price>
</listing>
</list>
下面是我试图处理 XML 文件的函数。
function namespacedXMLToArray($xmlData) {
return json_decode(json_encode(simplexml_load_string($xmlData)), true);
}
无论如何我可以跳过第一行的时间戳吗?
解决方案
推荐阅读
- android - WorkManager 触发但返回失败结果
- sql - 使用计数器更新现有数据的数据库列
- python - 使用 Pydantic 将每个字段设为可选
- sql - 如何从最多两个字段中获取数据
- c++ - 如何为 lambda 和标量引用重载模板函数
- leaflet - 传单绘制删除功能与属性
- php - 如何在 laravel 8 中为 created_by 和 updated_by 自动插入数据字段
- concurrency - 多核并发和并行的区别?
- flutter - 让它在日历上的推送日期改变她的水平页面在颤动,我该怎么办?- 颤动
- mysql - Laravel Eloquent 查询过滤器不起作用