By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

Shall I enable short tags?

P: n/a
Hi

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

Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
.oO(varois83)
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
Jul 17 '05 #2

P: n/a
>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.
Jul 17 '05 #3

P: n/a
"varois83" <va******@netzero.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi

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


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.
Jul 17 '05 #4

P: n/a
varois83 wrote:
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?


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/

Jul 17 '05 #5

P: n/a

Hi

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

Jul 17 '05 #6

P: n/a
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
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.
Jul 17 '05 #7

P: n/a
Kenneth Porter wrote:
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in
news:11**********************@z14g2000cwz.googlegr oups.com:
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.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.