- PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments.
- You may use any style based on your requirements.
- Single-Line code comments use C++ Syntax
- Multiple-Line code comments use C Syntax
- Unix Shell Syntax (Perl Style) is also used for single line comments
- Example: Single-Line C++ Syntax
1
2
3
4
5
6
7
| <?php
// Title: My first PHP code
echo "This is a PHP program.";
?>
|
- Example: Unix Shell Syntax
1
2
3
4
5
6
7
| <?php
# Title: My first PHP code
echo "This is a PHP program.";
?>
|
- Example: Multiple-Line C Syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| <?php
/*
Title: Test Code
Author: shafiq
Author URL: http://shafiq2410.wordpress.com
Email: shafiq2410@gmail.com
*/
echo "This is a PHP program.";
?>
|
No comments:
Post a Comment