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:
- It’s a Good Practice
- It saves a lot of time , you won’t need to read your code to understand what it does
- Make your code understandable for others, so that if many programmers are working on a same project, or when your boss fires you, it would be helpful for then next programmer to understand what you have done.
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 …
-
// Single line comment
-
-
-
# Single line comment
-
-
-
-
/* Multi-line
-
Line 1
-
Line 2
-
Line 3
-
*/
-
-
-
-
/**
-
* API Documentation Example
-
*
-
* @param string $bar
-
*/
-
-
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
-
<?
-
echo " Hello world !" ;
-
?>
Hello world in php using Variables
-
<?
-
$txt = "Hello World !" ;
-
-
echo $txt ;
-
?>
Hello world in php using Functions
-
<?
-
-
function hello () {
-
-
echo " Hello World !! ";
-
-
}
-
-
hello();
-
?>
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 .