1
我做查询Oracle数据库使用BLOB数据类型打开XML转换成使用PHP
我要生成一个字符串传递作为参数传递给simplexml_load_string功能存储XML内容的字段的字符串。
我收到的资源类型:
object(OCI-Lob)[111]
public 'descriptor' => resource(118, oci8 descriptor)
并使用此代码:
$query = "SELECT xmlcontent FROM myxmltable";
$stid = oci_parse($conn, $query);
oci_execute($stid);
$xml = '';
while (($row = oci_fetch_assoc($stid)) != false) {
// $xml = simplexml_load_string($row['XML']);
$xml = $row['xmlcontent'];
}
var_dump($xml);
我如何改变资源为字符串?
我wanto从对象转向串的XML是:
<?xml version="1.0" encoding="utf-8"?>
<VehicleValidation xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Validation Id="Validation">
<Vehicle>
<Year>2017</Year>
<Brand>One car brand</Brand>
</Vehicle>
<Brand>
<Info>
<Data>
<Address>
One car brand Address
</Address>
<Data>
</Info>
</Brand>
</Validation>
</VehicleValidation>
你能分享你的'XML'字符串和你的预期输出吗? –
只需将XML添加到问题 –
你能告诉我你想从这个XML中提取什么吗? –