MelWhetaer Posted October 23, 2007 Share Posted October 23, 2007 Hi there, I was asked this question today on an interview question paper but I wasn't able to answer it. "What is special about '<?=' in PHP?" Hope you can clear this up for me. Thank you Mel Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/ Share on other sites More sharing options...
cmgmyr Posted October 23, 2007 Share Posted October 23, 2007 it's just short hand (short tags) for echoing a variable <?=$name?> is the same as <?php echo "$name" ?> Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376437 Share on other sites More sharing options...
manixrock Posted October 23, 2007 Share Posted October 23, 2007 it's shorthand for <? echo ... ?> like instead of writing: <? echo $name ?> you can simply do: <?=$name?> Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376441 Share on other sites More sharing options...
marcus Posted October 23, 2007 Share Posted October 23, 2007 <? echo $name ?> that's shorthand too Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376442 Share on other sites More sharing options...
MelWhetaer Posted October 23, 2007 Author Share Posted October 23, 2007 Thanks for your speedy reply guys. So it's just short hand, great thanks for clearing that up for me (sorry about my lack of PHP knowledge, i'm working on it ). There isn't anything really special about it though right...lol Mel Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376446 Share on other sites More sharing options...
manixrock Posted October 23, 2007 Share Posted October 23, 2007 @mgallforever what is shorthand about this? <? echo $myvar ?> i think it's normal PHP code, and does not constitute a shorthand. Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376455 Share on other sites More sharing options...
GingerRobot Posted October 23, 2007 Share Posted October 23, 2007 It uses the short open tags. Full tags are <?php ?>, whilst short tags are <? ?>. Not all servers are set up to allow the use of short tags. I was quite surprised to see their continued support in php 6 Quote Link to comment https://forums.phpfreaks.com/topic/74490-solved-what-is-special-about/#findComment-376459 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.