Hey guys
I am building a page for myself and friends that will clean up html using php tidy
It works fine but I can not figure out hot to ad indents to the outputed html. I am very new to the tidy workings. here is the code i am using
Code:
<?php
$file= $_POST['file'];
$tidy = tidy_parse_string($file);
$tidy->_error_count;
echo "The following errors were detected:<br>";
preg_match_all('/^(?:line (\d+) column (\d+) - )?(\S+): (?:\[((?:\d+\.?){4})]:)
?(.*?)$/m', $tidy->errorBuffer, $tidy_errors, PREG_SET_ORDER);
$malestr = str_replace("line","\nline:",$tidy->errorBuffer);
$article1=nl2br(htmlentities($malestr));
echo "$article1<br>";
$tidy->CleanRepair();
echo"<textarea cols=\"80\"rows=\"30\">$tidy</textarea>";
?>
I will feel dumb if it is an easy fix but please if you can tell me how.
I have been trying for hours now.
__________________
I hope to build a site with something for every one
Please login or register to view this content. Registration is FREE
Last edited by bmcoll3278; 09-10-2009 at 06:02 AM..
|