PHP asXML() လုပ်ဆောင်ချက်
ဥပမာ
SimpleXML အရာဝတ္ထုမှ ကောင်းမွန်စွာဖွဲ့စည်းထားသော XML စာကြောင်း (XML ဗားရှင်း 1.0) ကို ပြန်ပေးပါ။
<?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 SimpleXMLElement($note);
echo $xml->asXML();
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
asXML() လုပ်ဆောင်ချက်သည် SimpleXML အရာဝတ္ထုမှ ကောင်းမွန်စွာဖွဲ့စည်းထားသော XML စာကြောင်း (XML ဗားရှင်း 1.0) ကို ပြန်ပေးသည်။
အထားအသို
SimpleXMLElement::asXML(filename)
ကန့်သတ်တန်ဖိုးများ
Parameter | Description |
---|---|
filename | Optional. If specified, the data is written to the file, instead of returning a string |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုတွင် စာတန်းတစ်ခု (သို့မဟုတ် ဖိုင်အမည် ကန့်သတ်ချက်သတ်မှတ်ထား လျှင် TRUE )။ ရှုံးနိမ့်မှုအပေါ် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 5.0+ |
❮ PHP SimpleXML အကိုးအကား