Re: Include File Errors with Comments

From: Date: Wed, 11 Mar 2009 17:55:32 +0000
Subject: Re: Include File Errors with Comments
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-289873@lists.php.net to get a copy of this message
Patrick Moloney wrote: > Thanks for all the replies. > As I said in my original post the comments are on the first lines of the > included file and are HTML comments. I'll have to look closer at comment > syntax - I see there are "empty comments" and issues with pairs of > double hyphens. > > My overall code worked well with 2 comment lines, then had issues with > the third. I eventually removed my third comment (no problem) then > copied my 2nd comment as the 3rd (problem returns). > I had some double hyphens "--" which seemed to cause problems sometimes. > I'm also thinking that it is seeing pairs of "--" that are causing > issues in odd numbers (half-pairs) only. > > I'll have to look closer. By definition, A comment declaration starts with <!, followed by zero or more comments, followed by >. A comment starts and ends with "--", and does not contain any occurrence of "--". This being said, depending on how you do it, some browsers will get it wrong, so to keep it simple: An HTML comment begins with "<!--", ends with "-->" and does not contain "--" or ">" anywhere in the comment. -- Thanks! -Shawn http://www.spidean.com

« previous php.general (#289873) next »