⊗ppSpXmTGT 23 of 83 menu

Texts of XML Tags Group in PHP

Suppose now in XML we have several tags:

<root> <tag>text1</tag> <tag>text2</tag> <tag>text3</tag> </root>

Now the property $xml->tag will store an iterable object:

<?php var_dump($xml->tag); // iterable object ?>

Let's iterate over our iterable object with a loop and output the values of our tags:

<?php foreach ($xml->tag as $tag) { echo $tag; // 'text1', 'text2', 'text3' } ?>

Given the following XML:

<root> <name>john</name> <name>eric</name> <name>kyle</name> </root>

Display each user's name on the screen.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline