why space comes after body tag in first line in inspect element?

217 Views Asked by At
<html>
  <head>
     <title>PHP</title>
   </head>
        <body>
        <?php 
                echo 'hello';
        ?>
        </body>
 </html>

update:

  1. If i used <fieldset> tag in above script problem become solved.

PHPFIDDLE -- RUN THE CODE AND CHECK IN INSPECT ELEMENT

enter image description here

1

There are 1 best solutions below

6
On

Not an answer but too long for a comment:
Please try again with

<html>
<head>
    <title>PHP</title>
</head>
<body>
<?php
function printit($s) {
    echo '<fieldset>',
        htmlspecialchars(var_export($s)),
        '<br />';
    for($i=0; $i<strlen($s); $i++) {
        printf('%02X ', ord($s[$i]));
    }
    echo '</fieldset>';
}

printit($_SERVER['REQUEST_URI']);
printit(trim($_SERVER['REQUEST_URI'])); 
?>
</body>
</html>

and add the output to your question.