Over a million developers have joined DZone.

Know PHP? Learn JavaScript

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

Years ago I learned PHP because someone else's web form was broken, and I needed to fix it. Apparently this kind of perforce-introduction to PHP is pretty common (and, some say, tends to form bad habits early), so I don't feel too bad about never having learned the language formally.

The result, though, is that my web programming brain leans pretty heavily server-side.

If you're like me, then Stoyan Stefanov's introduction to JavaScript for PHP developers might prove extremely useful.

Stoyan seems like a perfect person to learn from -- he's written six books on JavaScript and PHP -- and his blogpost and presentation are both very clear. For example, here's a PHP associative array:

$fido = array(
  'name' => "Fido",
  'barks' => true

and here's the JavaScript object literal he compares it to:

var fido = {};
fido.name = "Fido";
fido.barks = true;

The slideshare presentation, which compares many syntax feature side-by-side, is embedded below. Click through it, or check out Stoyan's article for a more compressed version with lots of helpful comments.


Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}