title: Folders and files of a .php script
body: <p>1) Let's say I write an app starting from index.php or admin/index.php (admin panel). (Maybe I should start writing code in some other place, or it depends, I am not sure; if this could be answered this could be good too). I write code within any of these index.php files and what is the thinking beind starting another .php file. When do I decide that, ok, this is no longer for index.php and I need to create another file. What could be the theory behind this? </p>
  
  <p>Like, lets say we have an application with /foleder1 with 20 .php files in there and one index.php file outside of this folder. What could be the thinking about this, why would the developer create the 20 separate files in this folder and so on. Or another app with 10 folders and 20, 30, 40, 50, 60, 70, 80, 90, 100, 110 in them consecutively. What could be the thinking about this? I mean, ok this folder has 110 files, that one 100, the developer must have made it because of this or this. I mean, what could be the theory about this? </p>
  
  <p>2) Can the process of creating new script files or folders be related to the html menu structure of the site. Like we have menu A, B, C, D, E, F, G in the html and we would probably create something like a.php, b.php, c.php, d.php, e.php, f.php, g.php for these? Or separate folders maybe in some cases but this division would be made. </p>
  
  <p>I am basically trying to get an understanding on how this works. I see it as all files having the same relation to a database (lets say just one table with columns). We can code the connection into any file, do certain things within any file and so on. But what is the process of dividing any application into folders and files? What could be the theory behind it? Where to learn that? (Just keep writing code and you fill figure it out / understand...). </p>
  
  <p>This seems like the very #1 thing for now that I would need to understand to get the whole "big picture" of this and all would be easier after that. </p>
  
  <p>Thanks. </p>