Using <?php or <? in short areas in a "PEAR"

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
Moocat
Forum Contributor
Posts: 143
Joined: Wed Oct 12, 2005 9:28 am
Location: USA

Using <?php or <? in short areas in a "PEAR"

Post by Moocat »

I've decided to follow the PEAR standard but I've got a few questions. If you use a short output statement should you use <?php or <?

as follows:

Code: Select all

<FRAME NAME="location_frame" SRC="<?=$goto?>"
or
<FRAME NAME="location_frame" SRC="<?php echo $goto; ?>"
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

<?php is the most portable way to embed php. It always work (unlike short_tags and asp_tags).
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Always use long tags. At least they're guaranteed to work...

Disable ASP tags...you won't like them if any application you run uses non standard HTML with tables... :wink:
User avatar
Moocat
Forum Contributor
Posts: 143
Joined: Wed Oct 12, 2005 9:28 am
Location: USA

Post by Moocat »

BTW Maugrim, I like your work, read your PM if you haven't already :)
Post Reply