$Muestra1 = $_GET['info1']; // ex. it gets " SI" $var1="_info1"; $contenido = substr_replace($var1, '$' . $Muestra1, 0, 0); echo $contenido; so my output is $SI_info1 instead of the content of the var $SI_info1