current()
PHP current() funksiyasi
❮ PHP SimpleXML ma’lumotnomasi
Misol
Birinchi elementga qayting va uni current() funksiyasi yordamida qaytaring:
<?php
$note=<<<XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Do not forget me this weekend!</body>
</note>
XML;
$xml = new SimpleXMLIterator($note);
// rewind to the first element
$xml->rewind();
// return current element
var_dump($xml->current());
?>
Misolni ishga tushirish »
Ta’rif va qo‘llanilishi
current() funksiyasi joriy elementni qaytaradi.
Sintaksis
SimpleXMLIterator::current()
Texnik tafsilotlar
| Qaytariladigan qiymat: | Muvaffaqiyatli bo‘lsa joriy element (SimpleXMLIterator obyekti sifatida). Muvaffaqiyatsiz bo‘lsa NULL |
|---|---|
| PHP versiyasi: | 5.0+ |
❮ PHP SimpleXML ma’lumotnomasi
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
