पीएचपी वर्तमान () समारोह
उदाहरण
पहले तत्व पर रिवाइंड करें और फिर इसे करेंट () फ़ंक्शन के साथ वापस करें:
<?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());
?>
परिभाषा और उपयोग
वर्तमान () फ़ंक्शन वर्तमान तत्व देता है।
वाक्य - विन्यास
SimpleXMLIterator::current()
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर वर्तमान तत्व (एक SimpleXMLIterator ऑब्जेक्ट के रूप में)। विफलता पर शून्य |
---|---|
पीएचपी संस्करण: | 5.0+ |
❮ PHP SimpleXML संदर्भ