I want to replace multiple strings in my tutorial app. This is what i have now but it doesn't work as wanted.
Controller
public function replaceStrings()
{
$data = 13;
$age = 11;
$cod = 45;
$test = "My data is %data%, My age is %age%, My cod is %cod%";
$new_message = str_replace('%data%',$data,'%age%','$age','%cod%','$cod', $text);
return $new_message;
}
I am expecting the function to return "My data is 13, My age is 11, My age is 45".
How do i get this done please?