Hướng dẫn php simplexml get all child nodes - php simplexml lấy tất cả các nút con
Tôi có một câu hỏi và câu trả lời chắc chắn đơn giản, nhưng nó chỉ thiếu hiểu biết từ phía tôi. Tôi có một tệp XML với giao diện sau (ví dụ ngắn)
Vấn đề của tôi là, tôi muốn đọc tất cả các thuộc tính từ một mục với ID 1234 với thuộc tính và giá trị của chúng, nếu tồn tại, trong một mảng. Tôi biết cách truy cập các mục nhất định với XPath. (Cảm ơn cộng đồng Stackoverflow tuyệt vời này :)) Nhưng làm thế nào tôi có thể sử dụng chức năng trẻ em () chỉ cho một mặt hàng nhất định? Như thế này
Cảm ơn bạn rất nhiều! (Php 5, Php 7, Php 8) SimplexMlelement :: Trẻ em - Tìm trẻ em của Node — Finds children of given node Sự mô tảpublicsimplexmlelement :: trẻ em (? chuỗi
Thông số________số 8Một không gian tên XML. isPrefix Nếu 1, namespaceOrPrefix sẽ được coi là tiền tố. Nếu false , namespaceOrPrefix sẽ được coi là URL không gian tên. 1, namespaceOrPrefix will be regarded as a prefix. If false , namespaceOrPrefix will be regarded as a namespace URL. Trả về giá trị Trả về một phần tử simplexmlelement, cho dù nút có con hay không, trừ khi nút đại diện cho một thuộc tính, trong trường hợp đó Ví dụVí dụ số 1 đi qua một giả giả 7 8 9Ví dụ trên sẽ xuất ra: The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son Ví dụ #2 sử dụng không gian tên The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son0 int(0) int(2) int(2) int(0) int(1) Xem thêm
aero ¶ ¶ 15 năm trước The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son1 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son2 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son3 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son4 Sebastian ¶ ¶ 17 năm trước The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son5 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son6 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son7 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 transglobe tại gmx dot de ¶ ¶ 14 năm trước The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son9 int(0) int(2) int(2) int(0) int(1)0 int(0) int(2) int(2) int(0) int(1)1 int(0) int(2) int(2) int(0) int(1)2 (Php 5, Php 7, Php 8) ¶ SimplexMlelement :: Trẻ em - Tìm trẻ em của Node int(0) int(2) int(2) int(0) int(1)3 int(0) int(2) int(2) int(0) int(1)4 The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 Sự mô tả ¶ publicsimplexmlelement :: trẻ em (? chuỗi int(0) int(2) int(2) int(0) int(1)6 int(0) int(2) int(2) int(0) int(1)7 int(0) int(2) int(2) int(0) int(1)8 int(0) int(2) int(2) int(0) int(1)9 Lưu ý: SimplexML đã đưa ra một quy tắc thêm các thuộc tính lặp vào hầu hết các phương thức. Chúng không thể được xem bằng var_dump () hoặc bất cứ thứ gì khác có thể kiểm tra các đối tượng. ¶ Thông số
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son3 $namespaceOrPrefix 6________số 8 ¶ 14 năm trước
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 ________số 8 ¶ Thông số
null 3________số 8 ¶ publicsimplexmlelement :: trẻ em (? chuỗi
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 Lưu ý: SimplexML đã đưa ra một quy tắc thêm các thuộc tính lặp vào hầu hết các phương thức. Chúng không thể được xem bằng var_dump () hoặc bất cứ thứ gì khác có thể kiểm tra các đối tượng. ¶ Thông số
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 ________số 8 ¶ 17 năm trước
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son3 false 0zyxwvu tại người dùng dot sourceforge dot net ¶ ¶ 18 năm trước
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 Rodmen tại Gmail Dot Com ¶ ¶ 13 năm trước
The person begot a son who begot a daughter; The person begot a daughter who begot a son; and that son begot a son8 Crescentfreshpot tại Yahoo Dot Com ¶ ¶ 14 năm trước
|