iwato Posted August 21, 2017 Share Posted August 21, 2017 <?=++$a?> <?=++$b?> <?=$private_id?> <?=session_id()?> I found this on the internet amongst some other code, and it appears to work. Unfortunately, I do not quite understand it. Is <?= a shorthand for <?php echo ... ; Link to comment Share on other sites More sharing options...
Gabrielphp Posted August 21, 2017 Share Posted August 21, 2017 Yes. <?= ?> is a shortcut for <?php echo ""; ?> All of the above will translate as follows: <?php echo ++$a; ?> <?php echo ++$b; ?> <?php echo $private_id; ?> <?php echo session_id(); ?> 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted August 21, 2017 Share Posted August 21, 2017 Its shorthand, but your PHP has to be permitted to allow it through PHP settings file under "short open tag" , else problems will occur. 1 Link to comment Share on other sites More sharing options...
Ingolme Posted August 21, 2017 Share Posted August 21, 2017 Just for reference, this technique is considered a bad practice because it's not portable. I would recommend against using it. It also has the issue that it's missing the "<?php" part of the processing instruction to let parsers know which type of system is meant to use the instruction. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now