I would like to see if you can help me with the following, I would like to know if it is possible to do a PHP function to replace some words. I am using str_replace
as follows:
$mensaje = "Hola!";
$mensaje = str_replace($mensaje, "Hola!", "Buen dia, Vuelve pronto");
With this I get this:
Good morning, come back soon
I would like to know how I can do to replace several $mensaje
with different result. Here something of what I'm looking for.
$mensaje1 = "Hola!";
$mensaje2 = "Buen dia!";
$mensaje3 = "Buena tarde!";
$mensaje4 = "Buena Noche";
$mensaje5 = "Cuidado con el coco!";
and the exit outside:
$mensaje1 = "Adios!";
$mensaje2 = "que te vaya bien!";
$mensaje3 = "Cuidado con el perro!";
$mensaje4 = "Ahi espantan!";
$mensaje5 = "Uyy! Qué miedo!";
I hope you can help me, Thanks in advance!