Skip to content

Instantly share code, notes, and snippets.

@emersoncortez
Created February 1, 2013 21:27
Show Gist options
  • Save emersoncortez/3ef14071b04a3b35f2e9 to your computer and use it in GitHub Desktop.
Save emersoncortez/3ef14071b04a3b35f2e9 to your computer and use it in GitHub Desktop.
<?php
// Algunas variables
$valor_nombre = 'Hola Mundo!';
$nombre_variable = 'valor_nombre';
$nombre_variable_que_tiene_nombre = 'nombre_variable';
// Utilizando variables variables
// Primer ejemplo.
echo $nombre_variable_que_tiene_nombre; // Salida: nombre_variable
// Segundo ejemplo
echo $$nombre_variable_que_tiene_nombre; // Salida: valor_nombre
// Tercer ejemplo:
echo $$$nombre_variable_que_tiene_nombre; // Salida: Hola Mundo!
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment