他のサーバーから動的に値を取得する文字列があります。文字列の値は
$string1 = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.microsoft.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AuthenticateUserResponse xmlns="http://microsoft.com/xml/namespace/2012/04">
<Authenticator>AE1001</Authenticator>
</AuthenticateUserResponse>
</soap:Body>
</soap:Envelope>';
私の質問は、通常、*$xml = simplexml_load_file("test1.xml");* を使用して XML ファイルをロードしますが、ここで私の要件ではStringです。この String 値を読み取って子ノードとその子ノードを抽出するにはどうすればよいですか?価値?例:
<Authenticator> and its value "AE1001" ?
これを配列に入れる方法はありますか?ノード値を簡単に出力できるようにするには?