php faci tot ce-ti trebuie si ai tot in variabile out HTML script var

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<?php
# faci tot ce-ti trebuie si ai tot in variabile $a, $b, $c s.a.m.d.
$out = <<<HTML
<script>
var a = {$a};
var b = {$b};
var c = {$c};
</script>
HTML;
?>
<html>
<body>
<script>
/* aici lucrezi deja cu variabilele js */
</script>
</body>
</html>