I have a file with the following content.
Some text bla-bla #date# other text #date# some other #date#
I need to replace #date# with some random date which I generate by using the following code with new random value for each #date#.
date('Y-m-d', strtotime( '+'.mt_rand(0,45).' days'))
At the moment all dates are replaced with the same value. Tks.