"make text between asterisks bold" Answer’s

0

A simple regex will do the trick:

$thenewtext = preg_replace('#*{2}(.*?)*{2}#', '<b>$1</b>', '**Hello World** of PHP');
Wednesday, March 31, 2021
 
McAn
answered 10 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :