Tuesday, January 21, 2014

Basic PHP Syntax


A PHP scripting block always starts with <?php and ends with ?>. A PHP scripting block can be placed anywhere in the document.
On servers with shorthand support enabled you can start a scripting block with <? and end with ?>.

For maximum compatibility, we recommend that you use the standard form (<?php) rather than the shorthand form.
<?php
?>

Comments in PHP

In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.
<html>
<body>

<?php
//This is a comment

/*
This is
a comment
block
*/
?>

</body>
</html>

No comments:

Post a Comment