Hi all,
I'm new to PHP and at this stage I'm still learning what is and isn't possible with PHP.
I want to add a script to my website that will automatically add the file size next to any link that leads to a non-HTML document.
For example, imagine I have a webpage that links to 50 PDF files. When someone loads the page, I want a script that will loop through each link on the page and add the file-size information.
I know I can achieve this by manually adding PHP code to each link, but is there a way to set up a script that will automatically add this to all the links on a page?
In other words, rather than me having to add a PHP reference at the end of every link on the page, is there a way I can add a piece of code to the top of the page that will then, somehow, search for every link on the page and automatically add some file size code to it?
As I said, I'm still coming to terms with what is and isn't possible with PHP, so I realise that what I'm asking may be impossible.
Thanks in advance for your help. :)