CodeIgniter Forums
As experienced web developer what is the cause of this issue? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1)
+--- Forum: Regional User Groups (https://forum.codeigniter.com/forumdisplay.php?fid=25)
+--- Thread: As experienced web developer what is the cause of this issue? (/showthread.php?tid=90754)

Pages: 1 2


RE: As experienced web developer what is the cause of this issue? - InsiteFX - 05-22-2024

You don't need to use the closing php tags any more in a pure php file.


RE: As experienced web developer what is the cause of this issue? - kenjis - 05-23-2024

When PHP processes a file, it just outputs lines outside the PHP tags.
So in your sample code, the empty line between the PHP tags is output.

Code:
$ cat test.php
<?php

?>
// This line
<?php

?>

Code:
$ php test.php
// This line
$

Code:
$ cat test.php
<?php

?>

<?php

?>

Code:
$ php test.php

$

Code:
$ cat test.php
<?php

?>
<?php

?>

Code:
$ php test.php
$



RE: As experienced web developer what is the cause of this issue? - luckmoshy - 05-24-2024

(05-23-2024, 02:29 PM)kenjis Wrote: When PHP processes a file, it just outputs lines outside the PHP tags.
So in your sample code, the empty line between the PHP tags is output.

Code:
$ cat test.php
<?php

?>
// This line
<?php

?>

Code:
$ php test.php
// This line
$

Code:
$ cat test.php
<?php

?>

<?php

?>

Code:
$ php test.php

$

Code:
$ cat test.php
<?php

?>
<?php

?>

Code:
$ php test.php
$

Of course, that is where the problem started and then the whole application started at 13 lines Thank you all for contributing it, but I also don't remember there was also someone past when him posted such an issue