I need to replace certain characters.
$to_replace = array( "{username}", "{email}" );
$replace_with = array( $username, $email );
Also, $key_value
is an array which gives me array key and values like:
array(
'site' => 'abc.com',
'blog' => 'blog.com'
'roll' => 42
);
Using
$message = 'This is a {username} speaking, my email is {email}, and my site is {site} with roll {roll}';
$message = str_replace( $to_replace, $replace_with, $message );
This way I can replace username and email, How can I make it to site, blog and roll?
Thanks!