PHP does not load or execute Javascript. Here is an order of execution:
- The user requests data from your web server.
- Your web server executes your PHP script, which outputs some HTML/Javascript.
- The web server sends the HTML/Javascript to the user's browser.
- The user's browser renders the HTML and executes the Javascript.
So yes, the PHP will finish executing before the Javascript is executed.