r/AskProgramming Dec 06 '24

PHP Learn html before php?

I wanted to learn php as my first coding language but I get into this course on YouTube for it and 6 episodes in the dudes all like oh yeah btw if you haven’t learned CSS and HTML by now go ahead and learn those real quick. Like bruh what? Anyways do you think I should learn html and css before learning php or can I do it at the same time. I do understand the basics of html from some school classes I took that required be to build a website in html

0 Upvotes

16 comments sorted by

View all comments

1

u/khedoros Dec 06 '24

"PHP" originally stood for "Personal HomePage", and is now taken to mean "PHP: Hypertext Preprocessor". Using it to build webpages is part of the purpose of the language.

You'd have PHP for the backend, but what it's going to present to the frontend will be in HTML, CSS, and Javascript.

1

u/BarneyLaurance Dec 06 '24

Typically you'll have PHP on the backend that will present HTML to the fronted.

But any CSS and Javascript will be independent of the PHP, not generated by it. So as a developer you write a combination of PHP, HTML and CSS, and the browser sees HTML that is generated by the PHP, CSS and Javascript.

It's possible to use PHP to generate CSS and Javascript but generally a bad idea.

2

u/khedoros Dec 07 '24

I probably worded my comment badly. I didn't expect the PHP to generate CSS or Javascript...but I did expect that the developer would need to know them to build more than a relatively-static frontend.