When I first started coding in PHP I found I had real problems with parse errors, especially with those characters that PHP doesn't want. I also wanted to convert whole chunks of HTML to PHP and it took me forever. I wish I'd found this at the time...
"HTML to AnyCode Converter from http://www.nutsoft.com "
It does exactly what it says and although it's not free you can download a full working demo and use it for 28 days.
I found it really useful in discovering just what PHP was expecting.
One last thing , before anyone suggests it.. I do not work for or am affiliated in any way with Nutsoft, I just thought it may be useful to newcomers to PHP 🙂