brown2005 Posted March 7, 2007 Share Posted March 7, 2007 when i am writing my php should i use: echo' '; or echo" "; and why? Link to comment https://forums.phpfreaks.com/topic/41600-using-or/ Share on other sites More sharing options...
monk.e.boy Posted March 7, 2007 Share Posted March 7, 2007 echo ''; it's quicker and less confusing. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/41600-using-or/#findComment-201550 Share on other sites More sharing options...
OOP Posted March 7, 2007 Share Posted March 7, 2007 Hi there, If you don't want the PHP interpreter to do anything for example replacing the variables with their values then use single quote otherwise choose double quote. Also, if you use double quote then some characters will have special meaning such as \t. Link to comment https://forums.phpfreaks.com/topic/41600-using-or/#findComment-201603 Share on other sites More sharing options...
Jenk Posted March 7, 2007 Share Posted March 7, 2007 <?php $var = 'foo'; echo '$var'; // outputs "$var" echo "$var"; //outputs "foo" ?> Link to comment https://forums.phpfreaks.com/topic/41600-using-or/#findComment-201606 Share on other sites More sharing options...
monk.e.boy Posted March 7, 2007 Share Posted March 7, 2007 <?php $var = 'foo'; echo '$var'; // outputs "$var" echo "$var"; //outputs "foo" ?> <?php $var = 'foo'; echo '$var'; // outputs "$var" echo '$var: '.$var; // <-- I like this one best echo "$var"; //outputs "foo" ?> Line 3 is ok for short lines of text, but for massive SQL statements with tons of variables in it it gets hard to read. I think line 2 is faster than line 3. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/41600-using-or/#findComment-201619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.