I have an string email address that comes from user input($option['footer_email']) and I want to replace it with mailto html tag. So far I tried couple of approaches and tried to use str_replace() as followed, but it didn't work out.
$email = array($option['footer_email']);
$replace = array('<a href="mailto:$option['footer_email']">$option['footer_email']</a>');
echo str_replace($email, $replace, $option['footer_email']);
and it returns syntax error, unexpected 'footer_email' (T_STRING), expecting ')'
I also tried to use preg_replace() but that one didn't help. How can I fix this issue?