New course! Every coder should learn Generative AI!
Try a free lesson0
It really depends on what you want to do. If you need to create a contact form for example, you‘ll need to learn PHP basics to be able to process the input on the server side the user made on your website. JavaScript is good to add animations and custom behaviour to your website such as a menu that can be hidden by click for example.
PHP runs on your server while JavaScript is run on the clients pc.