Re: Assign variable to a block of html code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



php mail wrote:
Hi All,

Is it possible to assign variable to a block of html code ?

Something like this :

$myblokvar = "
<table width="487" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="487" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/bartitle_login.gif" alt="Login" width="475"
height="30" /></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="produk"><table width="100%" border="0" cellpadding="3"
cellspacing="2">
          <tr>
            <td class="katalog">
            <?=$log_info?>
            </td>
          </tr>
          </table></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="produk">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
";

Although example above is not working, what I want to achieve is something
like that. Is it possible how can I do that ?

Regards,

Feris


You can use Heredoc quoting for this. (http://uk2.php.net/types.string)

---------
<?php
$log_info = "Your logged";
$myblokvar = <<<html
<table width="487" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="487" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/bartitle_login.gif" alt="Login" width="475"
height="30" /></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="produk"><table width="100%" border="0" cellpadding="3"
cellspacing="2">
          <tr>
            <td class="katalog">
            $log_info
            </td>
          </tr>
          </table></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td class="produk">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
html;

echo $myblokvar;
?>
---------

Darren

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux