PHP key() လုပ်ဆောင်ချက်
ဥပမာ
ပထမဒြပ်စင်သို့ ပြန်လှည့်ပြီး လက်ရှိသော့ကို ပြန်ပို့ပါ (လက်ရှိဒြပ်စင်၏ XML တက်ဂ်အမည်ဖြစ်သည်)။
<?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 key
var_dump($xml->key());
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
သော့() လုပ်ဆောင်ချက်သည် လက်ရှိကီး (၎င်းသည် လက်ရှိဒြပ်စင်၏ XML တက်ဂ်အမည်) ကို ပြန်ပေးသည်။
အထားအသို
SimpleXMLIterator::key()
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် လက်ရှိဒြပ်စင်၏ XML တက်ဂ်အမည်။ မဟုတ်ရင် မှားမယ်။ |
---|---|
PHP ဗားရှင်း- | 5.0+ |
❮ PHP SimpleXML အကိုးအကား