Last active
January 25, 2019 16:22
-
-
Save Skeiceee/79f1254334eb550be8389361aaa0026f to your computer and use it in GitHub Desktop.
PHP Array's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* | |
$users = array( | |
array( | |
"nombre" => "Victor", | |
"edad" => 21, | |
) | |
); | |
$user = array( | |
"nombre" => "Loreto", | |
"edad" => 20, | |
); | |
$users[] = $user; | |
foreach ($users as $user) { | |
echo "Mi nombre es ${user["nombre"]} y tengo ${user["edad"]} años"; | |
echo '<br/>'; | |
} | |
/*/ | |
$users = [ | |
[ | |
"nombre" => "Victor", | |
"edad" => 21, | |
] | |
]; | |
$user = [ | |
"nombre" => "Loreto", | |
"edad" => 20, | |
]; | |
$users[] = $user; | |
foreach ($users as $user) { | |
echo "Mi nombre es ${user["nombre"]} y tengo ${user["edad"]} años"; | |
echo '<br/>'; | |
} | |
// */ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment