I want to separate code from UI. But it seems like no matter what I do, I still construct a lot of HTML code / tags in my PHP code. Doesn't that kind of ruin the notion of separating code from UI?
you going to have to have html or how else is the web broswer going to read the code?
web browsers dont know how to read server side scripting like php/asp etc..
php is here for use of things that you cannot do with html. It helps fill in all the things html just cant do.
you will have to use html with php, but you will limit the html code.
Example:
if you have a database and you connect to it with php and display all the the records then all you have to do is basicly print/echo out the fields into a html table just one table data, then look that one table data / table row
and it will automaticly build the table from that one tr/td
so it helps on less html coding but depending on what you do you will still have alot of html code but its more advanced with php behind it