Code: Select all
$dom->get_elements_by_tagname("location")[0]
How do I get the first element of the array that's returned by get_elements_by_tagname() method in one expression?
I know I could easily do this:
Code: Select all
$location = $dom->get_elements_by_tagname("location");
$location = $location[0];
Thanks for reading.