Parsing ' . $file . ' ... '; $file_html = $path2html . $file; $h2t =& new html2text($file_html, true); $h2t->set_base_url('http://mydomain.com/htmlfiles'); $text = $h2t->get_text(); // create text file $filename_text = substr($file, 0, -5) . '.txt'; $file_text = $path2text . $filename_text; $fh = fopen($file_text, 'w') or die("can't open file"); fwrite($fh, $text); fclose($fh); echo 'Succesfully converted to ' . $filename_text . ''; } else { echo '
' . $file . ' ignored (not an html file).'; } } } closedir($handler); ?>