[Php 5, Php 7, Php 8]
DomDocument :: GetEuityByID - Tìm kiếm một phần tử có ID nhất định — Searches for an element with a certain id
Thông số
elementId
Giá trị ID duy nhất cho một phần tử.
Trả về giá trị
Trả về Domelement hoặc null
nếu phần tử không được tìm thấy.DOMElement or null
if the element is not found.
Ví dụ
Ví dụ #1 DomDocument :: GetEuityById [] Ví dụ
Các ví dụ sau sử dụng Book.xml có chứa những điều sau:
]> PHP Basics Jim Smith Jane Smith PHP Basics provides an introduction to PHP. ]]> PHP Advanced Programming Jon Doe
Some Data
*/$xmlDom = new DOMDocument['1.0', 'utf-8'];
$xmlDom->formatOutput = true; // we want a nice output
The element whose id is 'php-basics' is: book0
The element whose id is 'php-basics' is: book1
Paradox_haze tại Live Dot de ¶ ¶
12 năm trước
The element whose id is 'php-basics' is: book2
The element whose id is 'php-basics' is: book3
The element whose id is 'php-basics' is: book4
Carl2088 tại Gmail Dot Com ¶ ¶
13 năm trước
The element whose id is 'php-basics' is: book5
The element whose id is 'php-basics' is: book6
The element whose id is 'php-basics' is: book7
The element whose id is 'php-basics' is: book8
The element whose id is 'php-basics' is: book9
The element whose id is 'php-basics' is: book4
Paradox_haze tại Live Dot de ¶ ¶
Simon ở một nơi nào đó dot com ¶
elementId
1
elementId
2
elementId
3
elementId
4
elementId
5
elementId
6
The element whose id is 'php-basics' is: book4
15 năm trước ¶
Hoi ¶
elementId
8
elementId
9
null
0
The element whose id is 'php-basics' is: book4
2 năm trước ¶
Ẩn danh ¶
null
2
16 năm trước ¶
Hoi ¶
null
3
2 năm trước ¶
13 năm trước
null
4
Paradox_haze tại Live Dot de ¶ ¶
Simon ở một nơi nào đó dot com ¶
null
5
null
6
null
7
The element whose id is 'php-basics' is: book4