Say I have a string like this:
$string = 'The /*quick*/ brown /*fox*/ jumped over the lazy /*dog*/.';
How can I use a regular expression to find the occurrences of /* */ and replace each value like so:
/*quick*/ with the value of $_POST['quick']
/*fox*/ with the value of $_POST['fox']
/*dog*/ with the value of $_POST['dog']
I have tried with preg_replace using this pattern: ~/\*(.+)\*/~e
But it does not seem to be working for me.