Quote Originally Posted by image View Post
DAY 2 PHP PROGRAMMING

http://php.flashwebhost.com/tom/day_2_variables_4.php

Code:

<?php


$numboys = '20' ;
$numgirls = '25' ;


echo 'Total number of students = ' . ($numboys+numgirls) ;

This program have syntax error on line

Code:
echo 'Total number of students = ' . ($numboys+numgirls) ;
$ missing for numgirls.

Proper usage.

Code:
<?php

$numBoys = 20;
$numGirls = 25;

echo 'Total number of students = ' . ($numBoys + $numGirls) ;
Only strings values need to be enclosed within quotes (' or ").

Variable names, if two words, Capitalize first letter of 2nd, 3rd, etc.. word.