私のクライアントのサーバーはphpをサポートしておらず、多くの更新が必要なため、ページに.htmlをエクスポートしました。今度は、このページの一部をエクスポートして、別の場所にアップロードしたいと考えています。
2 つの ob_start(); を呼び出すにはどうすればよいですか?
サンプルページのsudoコード
ob_start(); //1 obstart
<html>
<head></head>
<body>
ob_start(); //2 obstart
<div class="special"></div>
//stop copying obstart #2
</body>
</html>
$contentString = ob_get_contents();
$divString = ob_get_contents();
file_put_contents( 'HTMLFile.html', $contentString );
file_put_contents( 'specialDIV.txt', $divString );