|
Posted by Janwillem Borleffs on 08/23/05 14:47
Kimmo Laine wrote:
> I've been concidering moving from short tags to complete ones. So I'd be
> converting every single <?= "something" ?> to <?php echo "something" ?>. The
> thing is: can I safely omit the semicolon in a single command tag. Or should
> I add it just in case? i.e. <?php echo "something"; ?>. I haven't gotten any
> warnings about it from php if I leave it out in a code, but is there some
> strict mode or any other reason why I should include it. The reason I'm
> asking this is that it seems to work without it, so are there any
> restrictions to it.
>
Yes, in this case you can savely omit the semicolon, as the last line
before the closing PHP tag closes the script:
Valid:
<?php
print 'hello'
?>
Invalid:
<?php
print 'hello'
print 'dosomething';
?>
JW
Navigation:
[Reply to this message]
|