开发者

Google chrome and PHP, ERROR IN CHROMES PARSING?

开发者 https://www.devze.com 2023-03-29 20:20 出处:网络
I have this simple code in a php file... <div id=\"main\"> <?php if { .... } else { .... } ?> </div>

I have this simple code in a php file...

<div id="main">
<?php 
     if {
     ....
     }
     else {
     ....
     }
?>

</div>

Now in mozilla, and IE it renders like this...

<div class="main">

<!-- HTML PARSED BY PHP -->

</div>

But in google chrome it renders like this.

<div id="main">

<!-- HTML PARSED BY PHP -->

div>

If I change the php file so that the php closing tag (?>) is li开发者_Go百科ke this after the ending curly bracket of the else statement like so...

}?>

Rather than....

}
?>

Then chrome renders the last div like so....

/div>

Is there an issue with chrome and php, and how can I stop it from happening. It is hard to validate any pages because of this weird issue.


So, as I said, not the browser is the one who renders the PHP script, is your installation. If the first line you should try to see what type of encoding your file has.

Change to ANSI if it differs.

Try to run your script on another installation/different machine.

Try an Online Tool

0

精彩评论

暂无评论...
验证码 换一张
取 消