I am creating a few hundred files that are found in a database. $row['content'] is all highly minified html.
I have tried a few solutions to format the html that exist as a string but no solutions have worked too well for formatting minified html on a single line.
I also have rules set on how I format like format using spaces not tabs and 3 spaces per indent.
$query = "select page.page_id, page.title, page.content from cms_page page"
if ($result = $mysqli->query($query)) {
while($row = $result->fetch_assoc()) {
file_put_contents($directory. $fileName, $row['content']);
}
}
}