Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Apply a style class to a php echo

Posted on 2008-06-26
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 143

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 111

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 111

Accepted Solution

Ray Paseur earned 500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

705 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