Apply a style class to a php echo

Posted on 2008-06-26
Last Modified: 2010-04-21
Hi experts,

I need to apply my font formatting class 'ranking2' to the output of this php script. Please can you tell me how I need to add the html to get the the php echo formatted with the 'ranking2' class.
$newText = $row_currentBlog['BlogEntry'];

$newText .=  "<BR class=\"ranking2\">"."This entry was recorded at: ".$blogdate."<BR>".$blogentry."<BR>";

Open in new window

Question by:RowdyBurns
  • 2
  • 2
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21873280
you mean, you are looking for how to defined the ranking2 class (css style) in your html document?

Author Comment

ID: 21873556
No. I can add the CSS class to the echo in the html document, but this is applied to the all of the echo. What I am trying to do is to format the text "This entry was recorded at:" and the .$blogdate.  before it is echoed in the html because the .$blogentry. needs to formatted differently.
LVL 108

Expert Comment

by:Ray Paseur
ID: 21873561
Try this...
$newText = $row_currentBlog['BlogEntry'];

$newText .=  "<br /><span class=\"ranking2\">"."This entry was recorded at: ".$blogdate."<br />".$blogentry."</span><br />";

Open in new window

LVL 108

Accepted Solution

Ray Paseur earned 125 total points
ID: 21873573
Oh, new criteria... OK, try this...
$newText = $row_currentBlog['BlogEntry'];

$newText .=  "<br /><span class=\"ranking2\">"."This entry was recorded at: ".$blogdate."</span><br />".$blogentry."<br />";

Open in new window


Author Closing Comment

ID: 31470907
The second one nailed it! Thanks lot lot for your help Paseur.
You have a good day.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now