PHP have the another method to start "<?. This is shorthand methode. Normally we recommended to PHP with "<?php".
Sample PHP
<?php
content need to placed
?>
PHP file extension is ".php".<html>
<html>
<body>
<?php
echo "Welcome to Way2discuss!";
?>
</body>
</html>
In the above example, PHP code written in the body content. PHP script line ends with semicolon.
"echo" - statement used to print the content into our webpage.
PHP have two methods to print the content, One is "echo" and another one is "print".
PHP have the 2 formt to comment the lines as follows
PHP comments : "//" and /* --- */
In PHP, we use // to make a one-line comment or /* and */ to make a comment block:
<html>
<body>
<?php
//This is a way2discuss comment
/*
multi line discussion comment
*/
?>
</body>
</html>
0 comments:
Post a Comment