I have a text template like this:
$template = [FIRSTNAME] say hello to [NAME]
I have an user array like
[user_name] => myname
[user_firstname] => myfirstname
and I would like to transform it with preg_replace so I tried this:
$replacement = '$user[user_${1}]';
$result['texte'] = preg_replace('/[(.*)]/', {$replacement}, $result['texte']);
without any success :(
preg_replace_callback()(,.,*,).