Re: Include File Errors with Comments

From: Date: Tue, 10 Mar 2009 21:43:53 +0000
Subject: Re: Include File Errors with Comments
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-289800@lists.php.net to get a copy of this message
Patrick Moloney wrote:
Does PHP preprocess the file but treat the comments as text because I never said it was HTML?
I've not had it do that.
Would PHP comments have to be inside PHP tags?
Yes. If you use a php comment it has to be inside a php tag. One issue I have seen though is xml/xhtml files. php sometimes sees the <?xml and assumes it is a php start tag. I assume the appropriate thing to do is turn off short tags in your php.ini file - but unfortunately a lot of 3rd party classes and apps make heavy use of them.
Am I correct in having just a fragment of HTML in the included file without the entire HTML organization? I'd like to have comments in the file.
Use html comments and it should be fine - or put php tags around the comments.


« previous php.general (#289800) next »