Ok after hours of pulling out my hair trying to parse HTML files using eregi_replace, I have run into a problem:
Assume I have an HTML file saved into a string variable, $raw_content:
<HTML>
<HEAD><TITLE>TESTING</title></head>
<BODY>etc etc etc...
...
...
</body>
</html>
Now, this HTML is anywhere from 20k-150k, spit out of a shopping cart database. I want to parse the HTML in that string variable to take out the title tag only. Sounds pretty easy, right? I used the command:
$output = ("<title>.+</title>", "", $raw_content);
Ok, so this definately works on many of my attempts, when the file/variable is less than 30k. However, when I try to parse an HTML file that is larger than 50-60k, it just doesn't work at all. I can't get eregi_replace to take out any text at all. I even tried doing:
$output = ("<.+>", "<!-- everything -->", $raw_content);
...which should just replace everything in the file with a comment, since eregi is greedy. And once again, this same command only works on 20-30k files, and not anything above 50-60k.
Is there something I'm missing? This is a continuation of a thread here:
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10254947
...where Sxooter was helping me use eregi to replace a block of text in HTML. As you can quite clearly see, I have encountered quite a dilemma...
Thanks in advance, for your help!
Take care,
... Christopher @ DatingVault
Free Seduction eBooks & Reports for Men:
http://www.DatingVault.com