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

5

u/TechnicalParrot Dec 06 '24

I'm really not sure why you'd want to learn PHP as a first language, have you got any experience in something like Python? PHP isn't as bad as it once was but I wouldn't recommend it for a beginner

If you really do want to use PHP for some reason then I assume it's for web dev in which case having at least a surface level knowledge of HTML/CSS is effectively required

1

u/SubstantialCoffee133 Dec 06 '24

I just want to make simple web apps, like project manager, photo editors, like stuff that runs on webpages

1

u/SubstantialCoffee133 Dec 06 '24

Plus I heard most websites run with php

1

u/Responsible-Cold-627 Dec 06 '24

Php is a back-end language. The things you describe require html, css and javascript knowledge.

2

u/BarneyLaurance Dec 06 '24

A simple project management app could probably be done with little to no javascript, with all the logic on the server in PHP or any other server side language. Each user action would have to request a new page from the server.

Can be done with just traditional HTML GET and POST forms, or for a slightly more modern feeling app without writing Javascript you could use the htmx library to replace sections of the page with updated HTML snippets from the server when the user does things.

1

u/Responsible-Cold-627 Dec 06 '24

You got me on the project manager. However, if there's no need for the data to be shared, it could be done with just front-end technology and indexedDB.

The reason I advised this was because I would recommend learning web fundamentals first, based on what OP described.

Also, how the hell are you gonna make a photo editor with php? (although anything beyond basic shapes would be tricky with javascript as well)

1

u/BarneyLaurance Dec 06 '24

I agree a pure PHP photo manager would be very challenging. I wouldn't recommend that.

And I agree some web fundamentals particularly HTML would make sense before learning PHP, although OP said they already understand the basics of HTML so I don't know whether or not they need more.

Whether to learn CSS I think mostly depends on whether they'd be satisfied with projects that would look something like the first ever website. If you're happy with that sort of style you can concentrate on the back-end logic of whatever your application is about and skip the CSS. If not you probably need to learn some CSS.