pickzy.com

C  |  C++  |  Objective-C  |  VC++  |  Win32  |  MFC  |  Java  |  Php  |  Delphi  |  Visual Basic  |  .Net  |  Networking  |  General  |  Games  |  Jobs  |  Javascript  |  




Menu

pickSourcecode.com


        

 




 

Php > Programs

 

Example of Comments in PHP

Example of Comments in PHP

<?php
// This is the comment sample from Paul Conrad's Independent Study
// This script will output to the browser 'Guess what? y is less than 5!'

/* Initialize some variables using C style comments
$a - contains a-coefficient
$b - contains b-coefficient
$x - value we are evaluating
$y - result from evaluating equation
*/
$a = 1; $b = 2; $x = 1;
$y = $a * $x + $b;

if ( $y < 5 ) // C++ style comment, check if y<5
{
# Shell style comment, display something when y<5
echo "Guess what? y is less than 5!";
}
?>

OUTPUT:
Guess what? y is less than 5!

 
Privacy Policy | About Us