getName()

PHP getName() funksiyasi

❮ PHP SimpleXML ma’lumotnomasi

Misol

XML elementi va uning bola elementlari nomlarini qaytaring:

<?php $xml=<<<XML <?xml version="1.0" standalone="yes"?> <cars>   <car id="1">Volvo</car>   <car id="2">BMW</car>   <car id="3">Saab</car> </cars> XML; $sxe=new SimpleXMLElement($xml); // Get the name of the cars element echo $sxe->getName() . "<br>"; // Also print out the names of the children of the cars element foreach ($sxe->children() as $child)   {   echo $child->getName() . "<br>";   } ?>
Misolni ishga tushirish »

ULASHISH

Ta’rif va qo‘llanilishi

getName() funksiyasi XML elementining nomini qaytaradi.


Sintaksis

SimpleXMLElement::getName()

Texnik tafsilotlar

Qaytariladigan qiymat: XML elementining nomi, string ko‘rinishida
PHP versiyasi: 5.1.3+

❮ PHP SimpleXML ma’lumotnomasi

W3Schools Pathfinder

Yutuqlaringizni kuzating – bu bepul!