lucavilla Posted November 11, 2007 Share Posted November 11, 2007 I have many html files named like these: c:\dir\femo-black.html c:\dir\loren-white.html c:\dir\spark-white.html c:\dir\kim-black.html c:\dir\paul-white.html How can I convert only the files named "c:\dir\*-white.html" to plaintext files named c:\dir\(original filename)-text.txt? Is there a PHP module that does a good quality conversion HTML to plaintext? Link to comment https://forums.phpfreaks.com/topic/76873-convert-some-files-from-html-to-plaintext/ Share on other sites More sharing options...
Daukan Posted November 11, 2007 Share Posted November 11, 2007 This will write the contents of one file to another. You will need PHP5. The directory needs to have the correct permissions $file_contents = file_get_contents('c:\dir\femo-black.html'); file_put_contents('c:\dir\femo-black.txt'); Link to comment https://forums.phpfreaks.com/topic/76873-convert-some-files-from-html-to-plaintext/#findComment-389211 Share on other sites More sharing options...
toplay Posted November 11, 2007 Share Posted November 11, 2007 I assume you're talking about wanting something more than strip_tags function of PHP http://us2.php.net/manual/en/function.strip-tags.php Do a google search. Here's one I found in a minute: http://www.howtocreate.co.uk/php/dnld.php?file=0&action=1 Link to comment https://forums.phpfreaks.com/topic/76873-convert-some-files-from-html-to-plaintext/#findComment-389214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.