How to put comments in php

Posted by chaabant on Dec 26, 2007

In php there are different ways to put comments , comments are very important .

Importance of php Comments in programming:

Any code that took thought to write will take thought to reread after several days, months or in some cases, years.

Ok , now let’s go back to How to put comments in php …

  1. // Single line comment
  2.  
  3.  
  4. # Single line comment
  5.  
  6.  
  7.  
  8. /* Multi-line
  9. Line 1
  10. Line 2
  11. Line 3
  12. */
  13.  
  14.  
  15.  
  16. /**
  17. * API Documentation Example
  18. *
  19. * @param string $bar
  20. */
  21.  
  22. function foo($bar) { } //code

Hello world in php

Posted by chaabant on Dec 26, 2007

Those are some ways to make a Hello world in php

  1. <?
  2. echo " Hello world !" ;
  3. ?>

Hello world in php using Variables

  1. <?
  2. $txt = "Hello World !" ;
  3.  
  4. echo $txt ;
  5. ?>

Hello world in php using Functions

  1. <?
  2.  
  3. function hello () {
  4.  
  5. echo " Hello World !! ";
  6.  
  7. }
  8.  
  9. hello();
  10. ?>

Welcome to Tutorials 4 PHP

Posted by chaabant on Mar 25, 2006

Welcome to Tutorials 4 PHP .

This site is still under construction ,I will start from A to Z in php .

Hope this project will help the Web Community understand how php works . I have other projects that will run with this project , like tutorials for html and tutorials for javascript .

If you have any question , use the contact form at the top of the page .

Good Luck .

Tarek .