Hello,
I have a simple HTML document that has a several DIVs...
<div id="17">Some content</div>
<div id="2">Other content</div>
<div id="23">And so on.</div>
As you can see the IDs are not sequentially numbered because they're used by a JavaScript function that reads them and takes an appropriate action. That part works perfectly.
Now, I'd like to have a PHP function read the HTML file and list the IDs. What's the simplest code for doing that? For instance, something like...
$fileName = "filename.htm";
$file = fopen($fileName, "r") or exit("Unable to open file!");
while(fgets($file)) {
something, something;
}
fclose($file);
Result...
17
2
23
I tried using fgets and various PHP string functions but I wasn't able to consistently get the ID property.
Thanks.