<?php is also only for PHP whereas <? can be used for other languages, I believe.
<% also works in some cases for PHP I think, though that's the same for ASP, etc.
Twey, can you explain a bit more about:?Code:<?=something()?>
Printable View
<?php is also only for PHP whereas <? can be used for other languages, I believe.
<% also works in some cases for PHP I think, though that's the same for ASP, etc.
Twey, can you explain a bit more about:?Code:<?=something()?>
Well; as I said before, <? and (I haven't mentioned this yet) <% works for php if it is enabled in the php.ini file. Otherwise, those above mentioned tags will not work (with PHP that is).
Quote:
can you explain a bit more about:?Code:<?=something()?>
is the same asCode:<?="This is a test" ?>
Hope this helps.Code:<?php
echo "This is a test"
?>
I get that... just like Twey's example.
But what's up with the '='? Does it set the implied output (beyond the <?) to the value? Or does it change the meaning of the <?= tag? Would it work with <?php=, etc.
Well, I just tested this:
and it didn't work.Code:<?php="This is a test";?>
No, it's just a character used in the opening tag. It has no syntactical meaning, any more than <? is related to numerical comparisons and conditionals.Quote:
Does it set the implied output (beyond the <?) to the value?
No.Quote:
Would it work with <?php=, etc.