What is the order of execution for PHP and JavaScript in this context?

When using both PHP and JavaScript in a web application, it's important to understand the order of execution to ensure that the desired functionality is achieved. PHP is a server-side language that runs on the server before the page is sent to the client's browser, while JavaScript is a client-side language that runs on the browser after the page is received. Therefore, PHP code is executed first, followed by JavaScript code.

<?php
// PHP code
$variable = "Hello from PHP!";
?>

<script>
// JavaScript code
var jsVariable = "<?php echo $variable; ?>";
console.log(jsVariable);
</script>