adding PHP to an external JAVASCRIPT file
<p>I have a website template which uses an external JAVSCRIPT file to plot data on to the graph. what I want to do is swap the demo content for php variables.</p>

<p>Original graph data</p>

<pre><code>  var data = [{
  label: "Facebook",
  data: [[1, 2], [2, 37], [3, 12], [4, 72], [5, 24], [6, 113], [7, 27]]
  },
  {
  label: "Google+",
  data: [[1, 3], [2, 45], [3, 16], [4, 48], [5, 12], [6, 125], [7, 26]]
  }];
</code></pre>

<p>MY Attempt</p>

<pre><code> var data = [{
label: "Facebook",
 data: [[&lt;?php echo '$daysago7'; ?&gt;, 2], [&lt;?php echo '$daysago6'; ?&gt;, 37], [&lt;?php echo   '$daysago5'; ?&gt;, 12], [&lt;?php echo '$daysago4'; ?&gt;, 72], [&lt;?php echo '$daysago3'; ?&gt;, 24],   [&lt;?php echo '$daysago2'; ?&gt;, 113], [&lt;?php echo '$daysago1'; ?&gt;, 27]]
 },
 {
label: "Google+",
data: [[&lt;?php echo '$daysago7'; ?&gt;, 3], [&lt;?php echo '$daysago6'; ?&gt;, 45], [&lt;?php echo '$daysago5'; ?&gt;, 16], [&lt;?php echo '$daysago4'; ?&gt;, 48], [&lt;?php echo '$daysago3'; ?&gt;, 12], [&lt;?php echo '$daysago2'; ?&gt;, 125], [&lt;?php echo '$daysago1'; ?&gt;, 26]]
</code></pre>

<p>}]</p>

<p>When I include my version, i get no graph at all.</p>
