I'm trying add a bold/strong tag the line headings of the follow string/text block:
Length Determination: the dimensions above show what center-to-center length can be achieved by the connecting linkage length shown for male spherical rod ends.
Material: aluminum.
Specials: specials are available at any volume.
Standards: MCP offers
But I can't get the regex to include multiple words. Here's my result:
Length Determination: the dimensions above show what center-to-center length can be achieved by the connecting linkage length shown for male spherical rod ends.
Material: aluminum.
Specials: specials are available at any volume.
Standards: MCP offers
Notice the word "Length" in "Length Determination" isn't bold/strong. That needs to be included. Can someone give me a quick hand?
My code:
$str = preg_replace_callback("/([^\s]+:)/i", 'makeStrong', $str);
function makeStrong($matches) {
return "<strong>" . $matches[0] . "</strong>";
}