所以可以說我有:PHP獲得元素
<?php
$template = '<img src="{image}" editable="all image_all" />';
$template .= '<div>';
$template .= '<img src="{image}" editable="yes" />';
$template .= '</div>';
?>
現在我想的是使腳本通過所有包含{圖像} src和檢查,看看是否有任何元素其中有
editable="all"
屬性。
如果是這樣:獲取第二個可編輯屬性,例如
image_all
並將其包含到src中。
你有沒有看着PHP的DOM解析器? http://simplehtmldom.sourceforge.net/ –
嘗試[簡單的HTML DOM分析器](http://simplehtmldom.sourceforge.net/) – Jashwant
使用PHP [文檔對象模型](http://www.php.net/manual /en/book.dom.php)。它會很好地爲你想要做的事情工作。 – AustinAllover