Well, pretty much everything is different The main difference is that PHP is server side and javascript is client side (runs on client's comptuter). PHP can connect to DBs, open files and generally do stuff that other programming languages can. Javascript can only manipulate a web page.
What do you mean by server and client side? As far as I know PHP files are creacted in the following way. First, website is built by the help of such the programs as Dreamweaver and can be configured on the localhost server. When a website is ready it is downloaded to hosting. What is about JavaScripts? What are advantages of JavaScripts and when it is better to use this programming language?
One is client side and the other is server side. Totally different languages! One is executed(on the server) before the page is presented to the browser and client side is executed or used after the browser loads the page.
Mostly browser touchups, such as showing a little menu that pops up when you click a button, are Javascript. Server-side or secure commands, such as accessing a database, are done with PHP. Javascript code is evaluated by the browser, while PHP is executed by the server and not the browser. They also have different syntax and functions.