I'm trying to set up a search system for a database and want to bold the search string that is found in each of the results--if the person searches for "ap" the list would return: apple pineapple
I've been trying to figure out how to manage this with str_replace but can't wrap my head around it. I figure I'll probably have to use regular expressions somehow---I just have no idea how to start tackling this.