⊗ppSpXmTT 22 of 83 menu

XML Tag Text in PHP

Suppose we have one tag in XML:

<root> <tag>text</tag> </root>

Let's get the text of this tag. Its value will be stored in the property of the object $xml:

<?php echo $xml->tag; // outputs 'text' ?>

Given the following XML:

<root> <name>john</name> </root>

Display the user's name.

Given the following XML:

<root> <user> <name>john</name> <surn>smit</surn> </user> </root>

Display the user's first and last name.

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