What I need is to replace what is in the variable ($ code) with (cars). For that I use a function with name (remove) using str_replace, the problem is that within the function remove does not recognize the variable ($ code) when I call the function . I hope you understand.
<?php
$codigo = "autos";
function quitar($mensaje){
$mensaje = str_replace("$codigo","autitos",$mensaje);
return $mensaje;
}
// llamo a la funcion
$nombre= quitar($nombre);
?>