I have a PHP script giving the information of cars, and following is the code. How can I bold only the labels of the data? $ShowInfo = "<table border=0 align=center width=\"100%\">\n\t<tr>\n\t<td width=\"60%\" valign=top><font size=3 face=verdana color=black><b>$a1[VehicleName] $a1[VehicleModel]</b> <br>Year: $a1[VehicleYear] <br>Mileage: $a1[mileage] miles <br>Colour: $a1[VehicleColor] <br>First Reg. Date: $a1[firstreg] <br>Engine Power: $a1[cc] <br>Chassis No: $a1[chassis] <br>Engine No: $a1[engine] <br>Transmission: $a1[trans] <br>Drive Side : $a1[driveside] <br></font></td>\n\t<td width=\"40%\" valign=top align=center><font size=2 face=verdana color=blue ><B>Price: $MyPrice</td>\n</tr>\n\n<tr>\n\t<td valign=top><br><b>Car ID: $a1[ListingID]</b><br><br>$desc<br>"; Code (markup):
clean up the html so that it's all the same, then try something like $ShowInfo = preg_replace("/([a-zA-Z0-9 ]+):/", "<b>$1 :</b>", $ShowInfo ); PHP:
Like so: $ShowInfo = "<table border=0 align=center width=\"100%\">\n\t<tr>\n\t<td width=\"60%\" valign=top><font size=3 face=verdana color=black><b>$a1[VehicleName] $a1[VehicleModel]</b> <br><b>Year:</b> $a1[VehicleYear] <br><b>Mileage:</b> $a1[mileage] miles <br><b>Colour:</b> $a1[VehicleColor] <br><b>First Reg. Date:</b> $a1[firstreg] <br><b>Engine Power:</b> $a1[cc] <br><b>Chassis No:</b> $a1[chassis] <br><b>Engine No:</b> $a1[engine] <br><b>Transmission:</b> $a1[trans] <br><b>Drive Side :</b> $a1[driveside] <br></font></td>\n\t<td width=\"40%\" valign=top align=center><font size=2 face=verdana color=blue ><B>Price:</b> $MyPrice</td>\n</tr>\n\n<tr>\n\t<td valign=top><br><b>Car ID: $a1[ListingID]</b><br><br>$desc<br>"; Code (markup): I believe this is what you were looking for anyways.