私はphpに次のhtml文字列を持っています
$html='<div style="display:block; float:left; width:40px;"> </div><a href="http://cosa.gr/index.php?cPath=15" class="headerNavigation">text</a>';
文字列テキストがプログラム的な方法である場合、a要素に「h1」html要素を追加する必要があります。以下のコードは、必要な結果を示しています。
$html='<div style="display:block; float:left; width:40px;"> </div><a href="http://cosa.gr/index.php?cPath=15" class="headerNavigation"><h1>text</h1></a>';
これを行う方法はありますか?