I don’t write PHP but if the PHP DOM works like all the other languages I’ve worked worth (IMO likely), you wouldn’t put phpsimplehtmldom into a script folder.
A DOM is the foundation of a web page which states the various elements and basic functionality that the individual tagged content on the page can act upon. As such, you’d think that the foundation of what happens in a page should be set as the page loads and shouldn’t be modified later (but see the last reference in this post)
So, typically the DOM is referenced at the top of each web page code (web pages in general and HTML or other predominantly text-type code is always read in sequence from top to bottom on the page), and the DOM file itself is normally placed in the root of the website code for easy reference.
The following looks like it might be intended to inject a DOM modification and might be placed in the content <BODY> which is an approach I’m not familiar with, but might be acceptable practice in PHP (again, I’m not actually a PHP coder). Might be an approach close to how you think it should work https://davidwalsh.name/domdocument
many thanks for the continued support - as i understand i do not have to put the extension into the same folder like the test-script.
i will have a closer look at the documents you have mentioned.