I’m trying to extract the href attribute of link as a string.
<a href="http://example.com" target="_blank" class="someclass">Read More</a>
I’m using the following to read the extract the attribute:
$link = simplexml_load_string($ad['meta_value']);
$order['logo'] = $logo['href']->asXML();
Instead of getting http://example.com I’m getting href="http://example.com". Beside using str_replace() is there a way to extract the attribute as a string?
Treat
@attributesas object and convert to string: