こんにちは私は次のことをしたいです:
$string_foo = "Hello world!";
if (is_not_fully_html( $string_foo )) {
$show = "<!doctype><html><head></head><body>{$string_foo}</body></html>";
}
$dom = new DOMDocument();
$dom->loadHTML( $show );
echo $dom->saveHTML();
$string_foo
しかし、次の場合はどうなりますか。
$string_foo = "<html>Hello world!</html>";
また
$string_foo = "<body>Hello world!</body>";
また
$string_foo = "<head></head><body>Hello world!</body>";
また
$string_foo = "<head></head>Hello world!";
また
$string_foo = "<body>Hello world!";
$show = ......................... {$string_foo} ...... はどのように整形式の HTML を返しますか?