$xml
XML 値を含むフィールドが 1 つあります。最初に、要素は改行 (行) ごとに区切られていませんが、改行のない文字列のように結合されていることに言及する必要があります。
最初に、XML 構造がどのように見えるかを簡単に「読み取れる」ように表示します。
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<p:queryBillingAccountResponse xmlns:p=" http://www.ibm.com">
<ns0:customerAccount xmlns:ns0=" http://www.ibm.com/xmlns/">
<AccountStatus>Paid</AccountStatus>
<ComponentCustomerAccount>
<Name>ADSL 4</Name>
<CharacteristicValue>
<Characteristic>
<Name>Balance</Name>
</Characteristic>
<Value>0.0</Value>
</CharacteristicValue>
<AccountStatus>Paid</AccountStatus>
</ComponentCustomerAccount>
</ns0:customerAccount>
</p:queryBillingAccountResponse>
</soapenv:Body>
</soapenv:Envelope>
<AccountStatus>Paid</AccountStatus>
</ComponentCustomerAccount>
</ns0:customerAccount>
</p:queryBillingAccountResponse>
</soapenv:Body>
</soapenv:Envelope>
しかし、もう一度言いますが、$xml フィールドの実際の値は簡単に読み取れるものではありません。例では、このように見えます
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><p:queryBillingAccountResponse xmlns:p=" http://www.ibm.com">.......
要素を削除したい:?xmlversion
soapenv:Envelope
および soapenv:Body
その属性とともに。最初とxml値の最後でそれらを削除したい。それ以外はすべてそのまま1 これを達成するにはどうすればよいですか? したがって、php フィールドの新しい値はqueryBillingAccountResponse
要素から開始する必要があります。ありがとうございました