Hello,
I dont know regex very well but I am using one below
that I modified from the web:

** Start code**

function RStripHeader($string) {
  return eregi_replace('<!-- .*Hstart("|\')?([^
"\']*)("| \')?.*>([^<]*)<!-- Hend -->', '', $string);
}

$the_file = "something.html";
$content = RStripHeader(file_get_contents($the_file));
$fhandle = fopen($the_file, "w");
fwrite($fhandle,$content);
fclose($fhandle);
echo "Done <b>".$the_file."</b><br>";

** End code***

Basically what I am trying to do above is:
open a file
delete everything that starts with
<!-- Hstart --> 
and ends with <!-- Hend -->

eg: 
it will delete everything below including 
"<!-- Hstart -->" and "<!-- Hend -->"

<!-- Hstart --> all this will be deleted! <!-- Hend
-->



Its working great for 1 file, but when I put it into a
for loop to handle multiple files....it takes ages for
10 files and sometimes just "hangs".

please help.

Thanks,
Mag

=====
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)


                
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. 
http://messenger.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to