RE: [PHP] print actual html code to browser
| From: | Adam Plocher | Date: | Wed, 07 Aug 2002 17:10:30 +0000 |
| Subject: | RE: [PHP] print actual html code to browser | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111538@lists.php.net to get a copy of this message | ||
If you have a pre tag around that, I believe it should work without a
problem.
If you want to convert the <'s and >'s in the tags to something that will be
displayed as greater than/less than signs by the browser, try this:
$var = "<p><table border='0' cellpadding='2'... Etc..";
$var = str_replace("<","<",$var);
$var = str_replace(">",">",$var);
Echo $var;
PHP should continue to render the variables within $var..
-Adam
-----Original Message-----
From: Jim Long [mailto:jim@jimlong.net]
Sent: Wednesday, August 07, 2002 10:03 AM
To: php
Subject: [PHP] print actual html code to browser
Hi,
I've done this by mistake in the past but can't seem to make it work now. I
want to print this html in a browswer (don't ask why...).
I want the following to show as actual html viewed in a browswer window with
a <pre> tag not shown so that it will hold the format. I want the varibles
to still work like varibles though.
echo
"<p><table border='0' cellpadding='2'
cellspacing='0'>
<tr>
<td bgcolor='#6600cc'>
<table border='0' cellpadding='3'
cellspacing='0' bgcolor='white'>
<tr>
<td>
<table
border='0' cellpadding='3' cellspacing='0'
bgcolor='white'>
<tr>
<td>$first_name</td>
<td>$last_name</td>
<td>-</td>
<td>Ave (+/- par):</td>
<td>$ave</td>
<td>-</td>
<td>Rank:</td>
<td>$i</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table
border='0' cellpadding='3' cellspacing='0'
bgcolor='white'>
<tr>
<td>$s1</td>
<td>$s2</td>
<td>$s3</td>
<td>$s4</td>
<td>$s5</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table></p>";
Thanks,
Jim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php