Jump to content

How can I mix a font tag with php database variables?

Recommended Posts

Hi everyone, I'm trying to get my head around blending in and out of php and html.  I've seen some simple examples which work great but now I have this variable that comes from the database and I would like to style the variable in-line with html markup.


Here's what I'm trying to do:




 echo "Price : ",'<Font size="100"> $tournament["pricePerPlayer"] </font>';

....more of the same code goes here...




I can't get $tournament["pricePerPlayer"] to be controlled by the font tag.  How do I do this?

Any help would be greatly appreciated.



Share this post

Link to post
Share on other sites

The <font> tag has been deprecated from HTML5, so you really shouldn't use it. You should be using CSS to control your visual presentation. You also have mismatched font tags (opening starts with upper-case, closing is all lower-case.

echo 'Price: <span style="font-size:50px">' . $tournament["pricePerPlayer"] . '</span>';

Ultimately it would REALLY be best to use a stylesheet, and then just give the span an ID or a classname, with the style for that ID/Classname defined in the stylesheet.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.