Replies: 1 comment 2 replies
|
I think you need this: use Laravie\Parser\Xml\Document;
use Laravie\Parser\Xml\Reader;
$xml = (new Reader(new Document()))->extract('
<api>
<user followers="5">
<id>1</id>
<email>crynobone@gmail.com</email>
</user>
<user followers="6">
<id>2</id>
<email>2crynobone@gmail.com</email>
</user>
</api>
');
$user = $xml->parse([
'users' => ['uses' => 'user[id,email,::followers>followers]'],
]);
print_r($user); |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
How can I resolve multiple identical nodes ?
like this
Error Result:
Array ( [id] => 1 [email] => crynobone@gmail.com [followers] => 5 )Should get two users, but only get one. : (
All reactions