Extension .Class in PHP files

1

Studying some codes on the web I found some files that use .class.php . What is the difference of this type for .php .

    
asked by anonymous 31.12.2017 / 01:24

1 answer

3

These files have a .class before.

Really, that's all it's different, because you can use whatever name you want. There is nothing that requires this. It is a convention that some people have adopted. What goes in can be anything, although some people usually put a class inside this file. Nothing prevents you from putting an HTML, a text or anything else inside. Your server is probably configured to expect a PHP code because of the .php extension and will call the PHP interpreter waiting for code that can be executed correctly.

Another tip is that object orientation is more of a conceptual rather than a technical thing. If it does not dominate very well it is better not to use it. In PHP it has very little advantage in its use.

    
31.12.2017 / 01:30