We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
array_to_xml
1 parent d9104a9 commit db7bb6aCopy full SHA for db7bb6a
README.md
@@ -390,22 +390,28 @@ $array = [
390
'Good guy' => [
391
'name' => 'Luke Skywalker',
392
'weapon' => 'Lightsaber',
393
+ '_attributes' => [
394
+ 'Rating' => '100',
395
+ ],
396
],
397
'Bad guy' => [
398
'name' => 'Sauron',
399
'weapon' => 'Evil Eye',
400
401
+ 'Rating' => '90',
402
403
]
404
];
405
406
$xml = array_to_xml($array);
407
408
// <?xml version="1.0"?>
409
// <root>
-// <Good_guy>
410
+// <Good_guy Rating="100">
411
// <name>Luke Skywalker</name>
412
// <weapon>Lightsaber</weapon>
413
// </Good_guy>
-// <Bad_guy>
414
+// <Bad_guy Rating="90">
415
// <name>Sauron</name>
416
// <weapon>Evil Eye</weapon>
417
// </Bad_guy>
0 commit comments