Link to home
Start Free TrialLog in
Avatar of RowdyBurns
RowdyBurns

asked on

Apply a style class to a php echo

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

Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

you mean, you are looking for how to defined the ranking2 class (css style) in your html document?
Avatar of RowdyBurns
RowdyBurns

ASKER

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

ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The second one nailed it! Thanks lot lot for your help Paseur.
You have a good day.