Possible Duplicate:
DOMDocument::load – PHP – Getting attribute value
I use the following code:
$str = '<a href="some_link">text</a>';
$dom = new DOMDocument;
$dom->loadXML($str);
I want to obtain the value of root element of $str.
In this example "some_link" should be returned. In real case $str is read from file.
How to achieve this?
Try: