i am writing a web site with a php on the server side. which i have never used before.
if i get it right it is procedural programming (which is another thing that i have never done)
my question is how to write code:
each procedure should be in a different file?
to separate it to various files?
maybe have one file that receive the request and then dispatches it?
in ojbect oriented things are a lot more clear…
please advise
You can do object oriented programming in PHP, and I prefer to structure it that way.
If you choose to stick with procedural style, 1 file per procedure is not the way to go, imagine if in OOP you did 1 file per method!
Grouping things is better, maybe you have a DB abstraction layer, in OOP you might make it a class, in 1 file. In procedural implementation, you’d have a bunch of procedures in 1 file. Probably named similarly.