<?php
//PHP 출력할 때
echo 'hi';
?>// SCRIPT 출력할 때
<script>
document.write('hi');
</script><?php
//php 문자열 합칠때는 .
echo 'hi'.'PHP';
?><!-- script 문자열 합칠때는 + -->
<script>
document.write('hi'+'script');
</script><?php
//php 변수는 $변수명
$a = 'hi';
$num = 1;
echo $a . '<br>';
echo $num;
?><!-- script 변수는 var 변수명 -->
<script>
var a = "hi";
var num = 1;
document.write(a + '<br>');
document.write(num + '<br>');
</script>