0
我試圖提取鏈接的href屬性作爲字符串。使用simplexml_load_string提取屬性
<a href="http://example.com" target="_blank" class="someclass">Read More</a>
我用下面的讀取提取物的屬性:
$link = simplexml_load_string($ad['meta_value']);
$order['logo'] = $logo['href']->asXML();
非但沒有http://example.com
我越來越href="http://example.com"
的。除了使用str_replace()有沒有辦法將屬性提取爲字符串?
什麼'substr'? –