Page 1 of 1

error in script

Posted: Thu Apr 27, 2006 11:40 am
by watson516
I have just starting php and have started a small project but I keep getting an error and I can't figure it out..

error:

Parse error: syntax error, unexpected $end in /home/.bocephus/stuff/public/index.php on line 254

Code: Select all

<?php
		switch ($level)
		{
			case USERLEVEL:
				echo <<<DONE
					html
				DONE;
				break;
			case STAFFLEVEL:
				echo <<<DONE
					html
				DONE;
				break;
			case ADMINLEVEL:
				echo <<<DONE
					html
				DONE;
				break;
			default:
				echo <<<DONE
					html
				DONE;
				break;
		}
		?>
$level has a value of 0, 1, 3, or 5
USERLEVEL=1
STAFFLEVEL=3
ADMINLEVEL=5

Posted: Thu Apr 27, 2006 4:38 pm
by feyd
with heredoc's the end delimiter cannot have whitespace before it on the line.