I want to use a PHP variable as a javascript variable - specifically I want to user the PHP variable session_id(); and use this as a javascript variable.
<?php
$php_var = session_id();
?>
<script language="JavaScript" type="text/javascript">
js_var = <?php echo($php_var ?>;
</script>
This seems like it should work for me but it doesnt can anyone suggest a better way?