TheVisitor
IS-IT--Management
Hello,
I'm new to PHP, and was wondering what would be the best way to extract text out of a html file. Now I have the file as a string, and let's assume I want to get text between the first occurrence of "<h1>" and the following "</h1>". Like:
<h1>This is the text I'd like to get</h1>
How do I get the text, and what method would be most CPU-friendly? I guess the quickhack I came up with, using strpos to find beginnings and endings and then substringing isn't the brightest idea here. Is sscanf an option here?
I'm new to PHP, and was wondering what would be the best way to extract text out of a html file. Now I have the file as a string, and let's assume I want to get text between the first occurrence of "<h1>" and the following "</h1>". Like:
<h1>This is the text I'd like to get</h1>
How do I get the text, and what method would be most CPU-friendly? I guess the quickhack I came up with, using strpos to find beginnings and endings and then substringing isn't the brightest idea here. Is sscanf an option here?