PHP is a server side scripting language.
JavaScript is a clientside scritping language.
If you're wanting to write stuff for the server to compute (i.e. calculations, database stuff, user info, etc) then use PHP. If you're wanting to enhance the User Interface, or do simple calculations you'd use JavaScript.