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? Link to comment https://forums.phpfreaks.com/topic/123935-solved-bolding-mysql-string-help/ 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"? Link to comment https://forums.phpfreaks.com/topic/123935-solved-bolding-mysql-string-help/#findComment-639761 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> Link to comment https://forums.phpfreaks.com/topic/123935-solved-bolding-mysql-string-help/#findComment-639762 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); Link to comment https://forums.phpfreaks.com/topic/123935-solved-bolding-mysql-string-help/#findComment-639766 Share on other sites More sharing options...
dennismonsewicz Posted September 12, 2008 Author Share Posted September 12, 2008 that worked thanks! Link to comment https://forums.phpfreaks.com/topic/123935-solved-bolding-mysql-string-help/#findComment-639770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.