Quote Originally Posted by annie View Post
I got an error while adding break in http://php.flashwebhost.com/annie/company.php

Code:
Parse error:  syntax error, unexpected '>' in /home/fwhphp/public_html/annie/company.php on line 3 
Code:
 <?php
$companyname = 'Relience';
echo $companyname <br> ; 
$companyname = 'Whirpool'; 
echo $companyname ;
Problem is on line number 3.

Code:
echo $companyname <br> ;
To fix, replace that line with

Code:
echo $companyname .  '<br>' ;
$companyname is a variable. We use DOT to join it with string <br>. String should start with a quote, end with a quote.

As for variable name, proper naming convention is $companyName, because it is two words, and easy to read.


Fixed code

Code:
<?php

$companyName = 'Relience';

echo $companyname .  '<br>'; 

// here we store another text to same variable $companyName
$companyName = 'Whirpool'; 

echo $companyname ;