Posted By

Masis on 09/27/10


Tagged

php syntax


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

adriennepalmer


Basic PHP Syntax


 / Published in: PHP
 

URL: http://phpforms.net/tutorial/tutorial.html

PHP scripting block can be placed anywhere in the document. It always starts with <?php>. The example of PHP code below sends the text “Oheon.com” to the browser:

  1. <html>
  2.  
  3. <body>
  4.  
  5. <?php
  6.  
  7. echo " oheon.com";
  8.  
  9. ?>
  10.  
  11. </body>
  12.  
  13. </html>
  14.  
  15. To make a single-line comment, use //. To make a large comment block, use /* and */. See the example below:
  16.  
  17. <html>
  18.  
  19. <body>
  20.  
  21. <?php
  22.  
  23. //This is a comment
  24.  
  25. /*
  26.  
  27. This is
  28.  
  29. a comment
  30.  
  31. block
  32.  
  33. */
  34.  
  35. ?>
  36.  
  37. </body>
  38.  
  39. </html>

Report this snippet  

You need to login to post a comment.