[FX.php List] Risks in multi-line echo statement?

Joel Shapiro jsfmp at earthlink.net
Wed Oct 25 11:51:39 MDT 2006


Hi all

Quick php formatting question:

Are there any risks to using a single echo statement with multiple  
lines inside the quotes, as follows?

echo ' // START ECHO
<table>
	<tr>
		<td align="right">Field A: </td>
		<td>'.$value['FieldA'][0].'</td>
	</tr>	
	<tr>
		<td align="right">Field B: </td>
		<td>'.$value['FieldB'][0].'</td>
	</tr>
</table>
'; //  END ECHO

I think it was on this list where people once discussed various ways  
of switching between html and php code.  This way *seems* to be a way  
to keep the html looking like html (both in the initial code, and in  
the browser's view source), but without needing lots of echo  
statements (1 per line), or using "\n", or having to use <?php echo  
$value['FieldA'][0]; ?> each time within straight html.  I've looked  
elsewhere online and haven't found other examples of this, so I'm  
wondering if there's a good reason for that.

TIA,
-Joel


More information about the FX.php_List mailing list