dennismonsewicz Posted September 12, 2008 Share Posted September 12, 2008 I have a string in mysql as follows (this is just an example): bird, frog, dog I want to be able to search the string and bold the last word of the string. In this example I want to bold dog. Any ideas? Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 what do you mean by "bold a string"? Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 12, 2008 Author Share Posted September 12, 2008 like to make it bold using HTML tags IE: <b></b>, <strong></strong>, <p style="font-weight: bold"></p> Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 12, 2008 Share Posted September 12, 2008 Maybe like this? $string = "bird, frog, dog"; $array = explode(", ",$string); $array[count($array)-1] = "<strong>".$array[count($array)-1]."</strong>"; $string = implode(", ",$array); Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 12, 2008 Author Share Posted September 12, 2008 that worked thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.