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? Quote Link to comment 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'); Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.