Jump to content

PHP inside echo's


Andrew R

Recommended Posts

Hi

 

How would I insert this (below) inside an echo that contains html?             

 

 

<?php do { ?>

 

<?php } while ($row_bh = mysql_fetch_assoc($bh)); ?>

 

 

 

<? if ($ree == 'YES') {
	  echo"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"bar\">
              <!--DWLayoutTable-->
              <tr> 
                <td width=\"249\" height=\"18\" valign=\"top\"><strong>TEEST</strong> </td>
                <td width=\"590\"></td>
              </tr>
            </table>
<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"3\" bgcolor=\"#F5F5F5\" class=\"border\">
              <!--DWLayoutTable-->
              <tr> 
                <td width=\"121\" height=\"22\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">1 </td>
                <td width=\"95\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\">2</td>
                <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">3</td>
                <td width=\"93\" valign=\"top\" bgcolor=\"#CCCCCC\">4</td>
                <td width=\"96\" valign=\"top\" bgcolor=\"#CCCCCC\">5</td>
                <td width=\"100\" valign=\"top\" bgcolor=\"#CCCCCC\">6</td>
                <td width=\"104\" valign=\"top\" bgcolor=\"#CCCCCC\">7e</td>
                <td width=\"77\" valign=\"top\" bgcolor=\"#CCCCCC\" class=\"bar2\"><!--DWLayoutEmptyCell--> </td>
              </tr>

              <tr> 
                
    <td height=\"23\" valign=\"middle\"></td>
    <td valign=\"top\"><td>
    <td valign=\"top\">< td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
    <td valign=\"top\"></td>
                
    <td align=\"right\" valign=\"middle\"><!--DWLayoutEmptyCell--> </td>
            </table>";



}

	  ?>

 

How would I put the php inside the echo without getting errors

 

Cheers  :)

Link to comment
https://forums.phpfreaks.com/topic/46352-php-inside-echos/
Share on other sites

If you don't want to escape all those quotes you can always do

<?
if ( $boolean )
{
?>
Lots of html and stuff could go here like this<br />
<?= $var ?> is also a cool shortcut to embedding php into HTML without having to type out a whole lot.
<img src="img.jpg" alt="nowai" />
<?
}
?>

Link to comment
https://forums.phpfreaks.com/topic/46352-php-inside-echos/#findComment-225482
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.