Simpan program berikut dengan ekstensi .php, misal: hello.php

<html>
<head>
     <title>Hello World</title>
</title>
<body>
<?
     echo "Hello World";
     // print "Hello World"; You can also use this as an alternative
?>
</body>
</html>

Kebanyakan PHP dipakai pada aplikasi web. Kode program di atas memperlihatkan bagaimana kode php di gabung bersama dengan kode html. Pada contoh di atas, php parser hanya akan memeriksa dan mengkompilasi semua kode yang berada diantara tanda <? dan ?>.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>