доступ к переменной php во внешний файл javascript

Я получаю значение var в php-код. Я хочу получить доступ к нему в файл test.js.

<?php session_start(); $var=$_SESSION['my_id']; // I want to access $var into test.js included below ?> <!DOCTYPE html> <html> <head> <script type="text/javascript" src="test.js"></script> <!-- AddThis Smart Layers END --> </head> <input type="submit" onclick="func();"> Button </input> //This function call test.js <body> 

Как я могу получить доступ к $ var в test.js?

Solutions Collecting From Web of "доступ к переменной php во внешний файл javascript"