The php script is executed on one computer called a web server. What it does is produce a stream of text. That stream is sent to another computer called a client where it is rendered by a program called a browser.
If the stream should happen to contain <SCRIPT> tags, the rendering, so to speak, is to treat that stream of text as a computer program to be executed on the client by, for example, the Javascript processor.
By "dynamically include", do you mean something like this
Code:
<html>
...
<div onclick="runPHP()">Click Me</div>
...
<script>
function runPHP() {
<?php
require 'do_some_php_stuff.php';
?>
}
</script>
<html>
If so, and if it worked, what happens is that on the web server the PHP processor spews forth the html up to the <?php ?> tags. Then executes do_some_php_stuff.php. Which in general outputs more html. And then sends the remaining html. What arrives at the browser is the html, not the php script.
When the div is clicked, the Javascript function runs. If the php script has produced valid Javascript, then more will happen inside the function; if not, then a Javascript error will occur and the function will stop.