@Steve Boulton,
A couple...
A line like:
?>
should end a php script in a web page. You likely have a line just prior to that script-ending line which contains a string with the newline ( \n ) in it and which should be terminated by a quote mark but isn't, i.e. a fragment of a character string. Ending the string properly might fix the problem if that's what it is.
You can also run php scripts from a command prompt on the server:
>php somescript.php
and see errors and there're also a couple of lines you can insert at the top of a php script which will show errors for php scripts inside a web page in a browser.
Hope that helps some.