Page 1 of 1
HTML Code in PHP
Posted: Thu Aug 15, 2002 1:27 pm
by pbsperry
I'm not a programmer by nature, but I'm struggling to learn PHP. I'm wondering how to format echo (or other) statements in a particular font/color/size? In the areas before/after my php script, I've got a certain font, but within the script the text doesn't match. I don't have particular code in mind, but am just looking for a general way of doing this.
Posted: Thu Aug 15, 2002 1:32 pm
by JPlush76
I usually do all my html formatting outside of php
IE
Code: Select all
<font size="2" color="#000000">
<? echo $variable; ?>
</font>
Posted: Thu Aug 15, 2002 1:33 pm
by llimllib
alright, here's the idea: php writes the page that controls the browser - it doesn't do it itself. Want to make red text in an html page? it looks like this:
Code: Select all
<font style="color:red">RedTextIsSoRad</font>
Want red text from an echo statement?
Code: Select all
echo '<font style="color:red">RedTextIsSoRad</font>';
See, you just use PHP to echo HTML? If you don't know HTML well, then an echo statement's not going to help you.