Skip to content

Commit cea313b

Browse files
committed
IHF: xml_to_array attributes added.
1 parent eb10da9 commit cea313b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,17 @@ Converts xml string to array:
299299
$array = xml_to_array('<?xml version="1.0" encoding="UTF-8"?>
300300
<root>
301301
<tasks>
302-
<task>
302+
<task priority="low">
303303
<to>John</to>
304304
<from>Jane</from>
305305
<title>Go to the shop</title>
306306
</task>
307-
<task>
307+
<task priority="medium">
308308
<to>John</to>
309309
<from>Paul</from>
310310
<title>Finish the report</title>
311311
</task>
312-
<task>
312+
<task priority="high">
313313
<to>Jane</to>
314314
<from>Jeff</from>
315315
<title>Clean the house</title>
@@ -325,16 +325,25 @@ $array = xml_to_array('<?xml version="1.0" encoding="UTF-8"?>
325325
// 'to' => 'John',
326326
// 'from' => 'Jane',
327327
// 'title' => 'Go to the shop',
328+
// '@attributes' => [
329+
// 'priority' => 'low',
330+
// ],
328331
// ],
329332
// 1 => [
330333
// 'to' => 'John',
331334
// 'from' => 'Paul',
332335
// 'title' => 'Finish the report',
336+
// '@attributes' => [
337+
// 'priority' => 'medium',
338+
// ],
333339
// ],
334340
// 2 => [
335341
// 'to' => 'Jane',
336342
// 'from' => 'Jeff',
337343
// 'title' => 'Clean the house',
344+
// '@attributes' => [
345+
// 'priority' => 'high',
346+
// ],
338347
// ],
339348
// ],
340349
// ],

0 commit comments

Comments
 (0)