I get var value into php code. I want to access it into included test.js file.
<?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>
How can I access $var into test.js?