PHP xml_parser_create_ns()ฟังก์ชัน
❮ การอ้างอิงตัวแยกวิเคราะห์ PHP XML
ตัวอย่าง
สร้างตัวแยกวิเคราะห์ XML ด้วยการสนับสนุนเนมสเปซ:
<?php
// Create an XML parser with namespace support
$parser=xml_parser_create_ns();
xml_parser_free($parser);
?>
ความหมายและการใช้งาน
ฟังก์ชัน xml_parser_create_ns() สร้างตัวแยกวิเคราะห์ XML พร้อมรองรับเนมสเปซ
เคล็ดลับ:หากต้องการเพิ่มตัวแยกวิเคราะห์ xml ให้ใช้ ฟังก์ชันxml_parser_free()
เคล็ดลับ:ในการสร้าง XML parser โดยไม่รองรับเนมสเปซ ให้ใช้ ฟังก์ชัน xml_parser_create()แทน
ไวยากรณ์
xml_parser_create(encoding, separator)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
encoding | Optional. Specifies the character encoding for input/output in PHP 4. From PHP 5 it specifies the character encoding only for output. In PHP 5.0.0 and 5.0.1, the default output charset is ISO-8859-1. From PHP 5.0.2, the default output charset is UTF-8. The possible values are ISO-8859-1, UTF-8 and US-ASCII |
separator | Optional. Specifies the output separator for tag name and namespace. Default is " : " |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ตัวจัดการทรัพยากรที่จะใช้โดยฟังก์ชัน XML อื่นๆ เกี่ยวกับความสำเร็จ FALSE เมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4.0.5+ |
❮ อ้างอิง PHP XML ที่สมบูรณ์