PHP xml_parse_into_struct() İşlevi
❮ PHP XML Ayrıştırıcı Referansı
Örnek
XML verilerini bir diziye ayrıştırın ( note.xml 'den ):
<?php
$xmlparser = xml_parser_create();
$fp = fopen("note.xml",
"r");
$xmldata = fread($fp, 4096);
// Parse XML data into an array
xml_parse_into_struct($xmlparser,$xmldata,$values);
xml_parser_free($xmlparser);
print_r($values);
fclose($fp);
?>
Tanım ve Kullanım
xml_parse_into_struct() işlevi, XML verilerini bir diziye ayrıştırır.
Bu işlev, XML verilerini 2 diziye ayrıştırır:
- Değer dizisi - ayrıştırılmış XML'den gelen verileri içerir
- Dizin dizisi - Değer dizisindeki değerlerin konumuna işaretçiler içerir
Sözdizimi
xml_parse_into_struct(parser, data, values, index)
Parametre Değerleri
Parameter | Description |
---|---|
parser | Required. Specifies the XML parser to use |
data | Required. Specifies the XML data to parse |
values | Required. Specifies an array with the values of the XML data |
index | Optional. Specifies an array with pointers to the location of the values in values |
Teknik detaylar
Geri dönüş değeri: | Başarı üzerine 1. 0 başarısızlık |
---|---|
PHP Sürümü: | 4.0+ |
❮ PHP XML Ayrıştırıcı Referansı