I'm working on a simple comments removal script in PHP. What I'd like to do is loop this entire script for all the files in the same directory. At this point I'm not concerned with subdirectories or subfolder. This example only has 1 file. I know we need to do a do..while loop but what would be the proper syntax?
<?php$file='home.html';$page = file_get_contents($file);$current = preg_replace('<!--[^\[](.*?)-->', '', $page);file_put_contents($file, $current);echo $current;?>
I have a folder filled with *.html files so this script would read each file with the *.html extension and apply the preg_replace.
Thanks in advance!
V