Created
September 23, 2010 03:50
-
-
Save bnvk/593059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I just encountered a weird little quirk of PHP that I spent awhile trying to resolve, so I'm posting this as a Google search turns up nothing. | |
When including a .php file in the midst of an html/view file using the include() function: | |
<?= include('myfile.php') ?> | |
Was producing a number '1' located after the end of include. The issue turns out to be a bug / feature or using short tags: | |
<?= | |
as opposed to: | |
<?php include('myfile.php'); ?> | |
the problem is that the short translates to: | |
<?php echo include('myfile.php'); ?> | |
which also produces the '1' hopefully this helps someone. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment