Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Use <?php, not <?
filburt1
Join Date: Feb 2002
Posts: 6,144

Maryland, US
by filburt1 filburt1 is offline 09 Jul 2003

I was reading through the PHP5 readme (which is basically the same as PHP4's), and there's a comment stating that you should always use <?php instead of <? when opening a PHP block. The reason is that the shorthand <? can be disabled; although it isn't by default, you should always develop your code with that in mind.

(of course I have to, now, also )
Views: 2555
Reply With Quote
Comments
  #2  
Old 09 Jul 2003, 16:39
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Also <? is ASP but it is acceptable

- miSt
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #3  
Old 09 Jul 2003, 17:45
N!ck N!ck is offline
 
Join Date: Mar 2002
Real name: Nick...duh
Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...
Reply With Quote
  #4  
Old 09 Jul 2003, 17:51
assassingod's Avatar
assassingod assassingod is offline
 
Join Date: Jul 2002
Today at 05:45 PM N!ck said this in Post #3
Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...
Not to my knowledge. The only tags I know for PHP are;
<?php, <? and <script language="php">
Reply With Quote
  #5  
Old 09 Jul 2003, 18:03
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
On no i got confused again. <% is asp but can work in php but its not recommended as its not supported by all coding environments. I need to read my book again. I'll be back with info

- miSt
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #6  
Old 09 Jul 2003, 18:12
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Today at 12:45 PM N!ck said this in Post #3
Can't you even use <% in PHP? I've never tried, but I think I've read that somewhere...
You can if you enable it in php.ini. I don't know why you'd want to, though; it's harder to type <% than <? (in the latter the two keys are right next to each other).
Reply With Quote
  #7  
Old 09 Jul 2003, 20:37
Gavin B. Gavin B. is offline
 
Join Date: Jul 2003
Yeo you can use <% but the ? sign is so much easier
__________________
Platinum-Central
Reply With Quote
  #8  
Old 10 Jul 2003, 18:32
N!ck N!ck is offline
 
Join Date: Mar 2002
Real name: Nick...duh
See? I was right, Steve... I don't use <% and haven't seen it used, but I just knew I'd read that somewhere...
Reply With Quote
  #9  
Old 11 Jul 2003, 12:47
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Yep you definately can use <%

- miSt
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 20:24.

Layout Options | Width: Wide Color: