I have a question about php, I'm pretty new to web programming and I still messed up a bit with php.
my question is, in a php file with the following structure
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>testero</title>
</head>
<body>
<?php
if(false):
?>
<p>hola</p>
<?php
else:
?>
<p>adios</p>
<?php
endif;
?>
</body>
</html>
the html that is shown corresponds to the php code that surrounds it, that is to say it is shown only bye, but nevertheless in the following example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>testero</title>
</head>
<body>
<?php
if(false){
?>
<p>hola</p>
<?php
}else{
?>
<p>adios</p>
<?php
}
?>
</body>
</html>
both options are shown, why does this happen? someone could explain it to me because I have been looking for stackoverflow (I have not found any questions regarding this topic) and for the official documentation of php and I do not find anything about it ...
Many thanks to all and forgive if it is a repeated question I am still a little lost.