This function is part of a class. I get the "else" to work if its more than 6 char but the first echo keeps giving me
"Parse error: syntax error, unexpected '"Name... "' (T_CONSTANT_ENCAPSED_STRING)"
no matter what I do
public function showOutput(){
if (strlen($this->name) < 6) {
echo " Name needs more than 5 characters ";
} else {
echo "Name " . $this->name;
}
}
EDIT I copied the code from one editor to notepadd++ and for some reason it cashed a " ' " on the line. It bothered me for an hour and a half hence signing up and asking. Thank you and sorry for the trouble. I did read the duplicate answers but none helped hence why I asked.
Thank you