I have a string that is something like "apple|banana|peach|cherry"
.
How can I use regular expressions to search this list and replace another string with a certain value if there is a match?
For example:
$input = 'There is an apple tree.';
Change that to: "There is an <fruit>apple</fruit> tree."
Thanks, Amanda