Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie tag question

Status
Not open for further replies.

Microbe

Programmer
Oct 16, 2000
607
AU
Hey all,

After a lot of years using ASP/VBScript, I am learning a bit of PHP with mySQL.

Question. I notice that sometimes tags use <?php ?> and sometimes just <? ?>

Is the "php" important in the tags? Why?

Steve Davis
hey.you AT HaHaHa.com.au

Me? I can't even spell ASP!

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination
 
Hi,

I see some people only use <? ?> and it works fine.
When I program, I however use <?php ?>

I dont know if there are *any* issues, maybe regarding older versions of php?

If you want to echo out a variable in the middle of something else, you can however do:
<?=$variable?>

Olav Alexander Mjelde
Admin & Webmaster
 
Whether you can use <? ?> ie short tags, depends on 'short_open_tag' settings in php.ini file.
If it is not on you have to use <?php ?>.
So using long tag is recommended for the application to be portable.
comments in php.ini also gives you reasons for NOT to use short tags.

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Thanks for that. I figured ther emay be some sort of config/legacy issue.

Steve Davis
ttf(a)HaHaHa.com.au

Me? I can't even spell ASP!

NOTE: This sig does not include any reference to voting, stars, or marking posts as helpful as doing so is cause for membership termination.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top