javascripthtmlend-tag

HTML Closing tag - PHP not seeing it


Possible Duplicate:
Why don’t self-closing script tags work?

I have a LAMP server recently installed on Ubuntu. What I am curious about is the following.

This code in file test.php works:

<html>
<head>
<script type='text/javascript'>
</script>
</head>
...

This file however does not (only shows data after the next </script> in the code)

<html>
<head>
<script type='text/javascript'/>
</head>
...

Why does PHP (or HTML) not acknowledge the end tag in the second case?


Solution

  • It is not acknowledged because:

    <script> 
    

    requires a closing

    </script> 
    

    and not just a / within the tag. Some HTML tags are like that.