Q:

php procedural file and folder structure

i would like to know the best way or best practise for structuring procedural php programming, in uni i learnt to have folders for each section like an "admin" "products" etc folder for each part of the website, and each of my folders had a index.php where all the php code went, is that a good way to do it? or even the right way?
Are you meant to have multiple index files in multiple folders?
I dont know i just look online and see so many different ways but no one ever explains right from wrong or good from bad etc.

A:

Generally speaking yes, you should try to separate your files into folders according to their functionality.
Please read the PSR-0 autoloading standard. I think it will help you to understand better why it's better to organize your code one way or another.
https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md

