I have a string which contains multiple * to represent a show rating. As people may use an individual * to represent something other than a rating, if there are two or more together (e.g. **) I will assume that only these represent ratings.
I want to change each occurrence of * when it is in a rating to be ★ (& #9733;) to improve presentation.
I'm currently using preg_replace as follows to match when two or more occurrences of * are found
$blurb = preg_replace("/[\*]{2,}/", "★", $s['longDescription']);
This, however, just places one ★ no matter how many occurrences. How can I modify this to replace each occurrence?
e.g. ** becomes ★★, *** becomes ★★★ etc.