I was in the lab today showing a simple PHP code sample to a colleague and my teacher saw it and asked "Why are you putting PHP together with HTML?". Even without understanding much I replied that it was just a simple example that I had made to show my colleague. He replied that even being an example it was not advisable to do this. I should have asked him why, but I did not ask and I had this little doubt.
Why is it not advisable to use PHP together with HTML? Should I create a specific document just for PHP separate from HTML? How do I call these codes in PHP without having to change the contents of the page?