<? and <?php

Status
Not open for further replies.

matthew1471

New member
May 13, 2007
242
0
0
Bournemouth, UK.
Hi,

I use wamp to develop locally on my laptop.

Sometimes when I use <? the php code is rendered onto the screen.

When I change it to <?php the php code executes fine.

Anyone know why this would happen?
 


But you better not use <? because if you move over your site to a more restrictive host it may not work without having to change all <? to <?php.
 
When if you are using shortcuts like <?="Hello World"?> you can get screwed.

Do the right thing: <?php echo "Hello World"; ?>
 
Status
Not open for further replies.