While JS is used for client side scripting (except in node.js) and
PHP is used for server side scripting. Simply,
JavaScript codes are executed by your web browser,
like the catchy animations or simple calculations . Your browser does all the processing. While
PHP runs on the server, where your webpage is stored.
read more >>