Mark
Mark

Reputation: 109

Output 1 Row only of PHP Array as Bold Text

I’m outputting the result of a MySQL query that contains information about users and chosen subjects. I would like to make one row only bold. I would like php to output this row only bold, but leave the rest as standard text. How do I do this?

$resultSet = $db->query ("...my query");  
echo $resultSet -> num_rows;
While($rows = $resultSet ->fetch_assoc())
{
   $subject [1] = $rows['First_Name']; //make this row output bold for example
   $subject [2] = $rows['Surname'];
   $subject [3] = $rows['Email_Address'];
   $subject [4] = $rows['Subject1'];
   $subject [5] = $rows['Subject2'];
   $subject [6] = $rows['Subject2'];

$subjectOutput = array_filter($subject, 'strlen'); 

$subjectString = implode($subjectOutput, '<br/>'); 

$output .= "<p> ". $subjectString."  </p>";
}

Upvotes: 0

Views: 471

Answers (2)

EneioArzew
EneioArzew

Reputation: 58

Well, since you're outputting it as a string with HTML tags, you could just do it like so

$subject [1] = '<b>'.$rows['First_Name'].'</b>';

It's dirty but I believe it should do the trick. Unless, of course, if you're going to be using the information somewhere else, my solution won't be of much help, I think.

Upvotes: 1

Himanshu Jangid
Himanshu Jangid

Reputation: 385

You can do something like this

p::first-line{
font-weight: bold;
}

Upvotes: 0

Related Questions