How do I put HTML code in PHP?
How do I put HTML code in PHP?
You can Echo HTML within PHP like so:
echo "<a href=\"http://filesharingtalk.com/index.php\" target=\"_blank">filesharingtalk.com</a>";
However you must notice that I used quotation marks within quotation marks and when yo do this in PHP you must Escape those quotation marks with a \ slash.
However if you have a large amount of HTML it sometimes best to just Exit PHP and if needed put your PHP inside the HTML like so:
<table>
<tr>
<td><?php echo $message; ?></td>
</tr>
</table>
Hope this helps. Best thing for you to do is download the PHP documentation from www.php.net.
Or you could use single quotes without escaping, and concentacating things like line breaks and tabs (single quotes don't accept any escaped characters except for \'.
You might find Heredoc to be useful, depending on what you're trying to do...
Code:echo <<<HTML Put a <i>string</i> with... <blockquote>HTML code</blockquote> ...in <q>here</q>. HTML;
one thing thats had me confused somewhat is: is there a difference (besides looking different) betweenandCode:echo "<b>hello world</b>";just cos i usually use print, but whenever i see code its usually with echoCode:print("<b>hello world</b>");
<insert signature here>
Not a whole lot. What is the difference between echo and print?Originally posted by vivitron 15@14 April 2004 - 10:35
one thing thats had me confused somewhat is: is there a difference (besides looking different) between
andCode:echo "<b>hello world</b>";
just cos i usually use print, but whenever i see code its usually with echoCode:print("<b>hello world</b>");
cool cheers - its bugged me (only a little) for a while now
<insert signature here>
it is easyier to just close php and start html and do it over...and over...and over
Heredoc will break on some crappy hosts. 1&1 is an example.
Bookmarks