Should I Learn HTML Before PHP?



Should I learn HTML before PHP?

You can learn to program in PHP before you learn any HTML. However, since the majority of PHP code interacts with web pages, you really should know some HTML first.

I’ve heard that PHP often interacts with AJAX.

AJAX is built on HTML. And if you create a website with PHP, the HTML is the output of the HTML.

In that case, I don’t need to know HTML because the compiler or interface will create the HTML for me.

You should know the HTML code so you can debug it or tweak it.

Which one is harder?

Most people would say learning PHP is harder. Learning HTML is faster, and it helps you when you start experimenting with PHP.

I wonder if learning HTML is counter-productive, since I might learn PHP but have no need to learn HTML.

HTML is the backbone of the internet, or at least, webpages. You can’t go wrong learning it.

I’ve seen plenty of webpages go wrong.

If you learn HTML first, you might get paid to do web design or debug webpages while you are learning PHP. After you learn PHP, you can get paid to debug webpages, server applications and everything in between.

I heard that HTML is pretty basic.

You can get the basics from a good tutorial and get good at it over a long weekend. That’s why kids can set up their own websites now to complain about their parents, long before they are allowed to drive.

Are there any cons to learning HTML later?

You might use the PHP web scripting to create a page and have no idea why it looks wrong afterward.

I heard I might need to learn CSS or JavaScript instead of HTML.

You’d have to learn HTML before you can do anything right with CSS or anything good with JavaScript. But PHP lets you make the website interactive without those two tools.

Fine, all start with HTML. I’ll start on PHP next week.

source

Reply