HTML Code in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pbsperry
Forum Newbie
Posts: 6
Joined: Thu Aug 15, 2002 1:27 pm

HTML Code in PHP

Post 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.
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

I usually do all my html formatting outside of php

IE

Code: Select all

<font size="2" color="#000000">
<? echo $variable; ?>
</font>
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post 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.
Post Reply