PHP For the Absolute Beginner: First PHP page

As you can see above, all PHP code needs to be inside opening and closing PHP tags <?php and ?> 
We can write document that contain only php code or we can insert php code inside HTML document like this: 


<html>
      <head>
          <title>My First PHP page</title>
      </head>
      <body>
<?php print ('Hello World!') ; ?>
     </body>
</html>
Comments in PHP:
PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. For example: 

<?php
    
echo 'This is a test'// This is a one-line c++ style comment
    /* This is a multi line comment
       yet another line of comment */
    
echo 'This is yet another test';
    echo 
'One Final Test'# This is a one-line shell-style comment?>

Php is not case sensitive.However all variables are case-sensitive in PHP:

For example if echo is same as ECHO, but $VARIABLE is not the same as $variable.

Share on Google Plus

About Negmardesign

0 comments :

Post a Comment