この方法でhtmlを作成しようとし、自己終了タグを作成しようとします:
$doc = new DOMDocument();
//document creation here...
function render()
{
$t = array(
'></area',
'></base',
'></basefont',
'></br',
'></col',
'></hr',
'></img',
'></input',
'></link',
'></meta'
);
$str = str_replace($t,"/", $doc->saveHTML(), $count);
echo $str;
echo $count;
}
まだ動作しません。それは交換ではなく、$count返品され0ます。私は何かを逃したのですか?空のタグを適切に取得する方法、<img>またはそうでない<input>ようにする方法は??<input /><input></input>
ありがとう。