I am fairly new to PHP/mysql and was reading an online tutorial and
learned that my short tags weren't enabled.
At this time I have no need for them, my setup apache/mysql/php runs on
my PC just to test code.
Shall I enable short tags or not?
Windows XP pro
PHP 4
Thanks a lot
Patrick
>I am fairly new to PHP/mysql and was reading an online tutorial and
>learned that my short tags weren't enabled.
Good.
>At this time I have no need for them, [...]
And you don't really need them.
>Shall I enable short tags or not?
No.
Micha
In a follow up to Michael, here is a scenario why.
You just finished writing a web app, wth 100's/1000's of code lines, heaps
of includes, sub apps etc, making use of short tags. You then upload to your
newly purchased webspace, and it doesn't work cos they have short tags
disabled.
You will have fun then, altering the many instances of short tag code.
If you don't use short tags, it will still work as expected on a server with
short tags enabled. Much more friendly.
I have downloaded a number of cms's that were apparently all the rave, only
to find they were written using short tags. My test server doesn't have them
enabled, so to preview them, I had to go through and alter. Not nice. Ended
up deleting, and looking at others.
I like short tags because you can do ASP style <?=$var?> echos. Most ISPs
leave it on since there's not much of a reason to turn it off.
You're asking one of the "religious" questions--you won't be getting
fair answer here.
You can enable short tags. Short tags are cool and fast (in terms of
coding and execution). When short tags are enabled, you _may_ encounter
some problems when you're outputting XML codes via PHP; this however
can be solved by coding in "such a way".
Most of the servers should support short tags; but there may be few
that don't support.
If you use short tags and if the server doesn't support it, you can
easily do search and replace (ie, <?= to <?php echo). But, there may be
few or many dumb clients who may not be knowing how to handle this
situations.
Personally, though I'm (still) a good fan of short tags, now I'm
moved to long tags. My suggestion is to enable short tags, but to code
in long tags--so that you achieve wide range of compatibility. (If you
disable short tags but did try to output XML, there are chances such
PHP code may not be usable when running on servers with short tags
enabled).
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
This is the original poster. I want to thank everybody who took the
time to answer. I won't enable them at this time.
Thanks again
Patrick
> If you use short tags and if the server doesn't support it, you can
> easily do search and replace (ie, <?= to <?php echo). But, there may be
> few or many dumb clients who may not be knowing how to handle this
> situations.
Servers (actually, server-side interpreters), not clients. The clients
never see the PHP.
I meant, clients==customers. My English is very poor; sorry.