Both PHP and JavaScript have a plethora of tools and libraries big enough to do almost anything as far as web development goes.
That said, I would always write JavaScript over PHP, except for those rare situations where PHP is the only option (the codebase is already PHP or the required platform only supports PHP). I just find it nicer to write and read.
Not that it matters, I find Python to be a much better choice in most situations.