@DasherDec 26.2011 — #PHP is server based, and Javascript is client based. Anything that is being executed in the browser by definition is too late to run back to the server, and be executed. No way to do that.
In Javascript just put: document.write("Testing");
@TheBearMayDec 26.2011 — #Could use AJAX to call a PHP script on the server, but otherwise the order of execution is always server based code (PHP, etc), and then HTML and client based code (javascript, etc.)
@007JulienDec 27.2011 — #You can too write [code=php]<script type='text/javascript'> function test() { alert("<?php echo "Testing"; ?>"); } test();// to call the function </script>[/code]