What to Learn first – PHP or JavaScript

If you are asking this question, then that means you want to learn AJAX –which has both components, PHP and Javascript.

Now what I’m going to say has some bias, as I learnt PHP first, here we go.

Let’s say you learnt Javascript first, now you want to use it in AJAX, can you make a website like facebook with Javascript alone? No. Yes you could learn Node.js, but then that’s advanced – we would be going on a different track there, you wouldn’t even need to learn PHP.

But if you do want to learn PHP, let’s say you learnt PHP, then you want to practise using AJAX, can u do it. Yes, copy-paste simple Javascript code.

And for that reason I suggest learning PHP first. Some more reasons:

  1. It is easier to learn; you’ll learn fundamental concepts about programming
  2. You should learn things like Form Submission, Database access before going to AJAX

You need to keep up the practice of one language (PHP) whilst you’re learning another (Javascript) or you will forget the former and have to relearn.