error in script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
watson516
Forum Contributor
Posts: 198
Joined: Mon Mar 20, 2006 9:19 pm
Location: Hamilton, Ontario

error in script

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

with heredoc's the end delimiter cannot have whitespace before it on the line.
Post Reply