New to PHP…searched the manual, just don’t understand how to put it all together. I’m trying to go through a folder and display each html file as it’s contents…that part works. I can’t figure out how to change a div id incrementally.
This code works for displaying the what I want I just need unique id’s in my divs.
$dir = realpath('./path/to/folder/of_files/');
foreach (glob($dir .'/*.html') as $page){
$div = file_get_contents($page);
echo ("<div class=\"interface\" id=\"ID_$id\">$div</div>");
}
Thanks in advance.
If
$idis just some integer you can stick an$id++;somewhere…