1
Studying some code on the web I found some files that use .class.php
. What is the difference between this type and .php
.
1
Studying some code on the web I found some files that use .class.php
. What is the difference between this type and .php
.
3
These files have a .class
before.
Really, that’s all that’s different, because you can use whatever name you want. There’s nothing that requires it. It’s a convention some people have adopted. What goes inside can be anything, although some people usually put a class inside this file. Nothing prevents you from putting an HTML, text or anything else inside. Your server is probably set to expect PHP code because of the extension .php
and will call the PHP interpreter who expects a code that can be executed correctly.
Another tip is that object orientation is more of a conceptual thing than a technical thing. If you don’t master very well, it’s better not to use it at all. In PHP has very little advantage in its use.
What knowledge would you recommend me to learn to evolve in the use of PHP?
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
It is still text file, the name will be.class file with php extension
– Sveen
but what’s the difference?
– Adri Silva
only the in name, you can use to say that the php file has a class, just to leave organized, but does not change anything
– Sveen