Last active
July 23, 2018 02:11
-
-
Save yoander/3ae5c6b039782a8d949d6d9893c84da0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$countries = [ | |
['country' => 'Spain', 'lang' => 'ES', 'currency' => 'EUR'], | |
['country' => 'USA', 'lang' => 'EN', 'currency' => 'USD'] | |
]; | |
foreach ($countries as ['country' => $countryName, 'lang' => $language, 'currency' => $currency]) { | |
echo "<strong>Country: </strong> $countryName, <strong>Language: </strong> $language, <strong>Currency: </strong> $currency"; | |
echo nl2br("\n"); | |
} | |
// Country: Spain, Language: ES, Currency: EUR | |
// Country: USA, Language: EN, Currency: USD |
This file contains hidden or 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 | |
echo "<strong>Countries:</strong>", nl2br("\n"); | |
$countries = [ | |
'SPAIN' => ['EUR', 'ES'], | |
'USA' => ['USD', 'EN'], | |
'ECUADOR' => ['USD', 'ES'], | |
'CUBA' => ['CUC', 'ES'], | |
'FRANCE' => ['EUR', 'FR'] | |
]; | |
foreach ($countries as $countryName => [$currency, $lang]) { | |
echo "<strong>Country: </strong> $countryName, <strong>Currency: </strong> $currency, <strong>Language: </strong> $lang"; | |
echo nl2br("\n"); | |
} |
This file contains hidden or 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 | |
$playerRank = [ | |
['Carlsen', 'Norway', 2842], | |
['Caruana', 'USA', 2822], | |
['Mamedyarov', 'Azerbaijan', 2801], | |
['Ding Liren', 'China', 2797], | |
['Kramnik', 'Russia', 2790], | |
]; | |
[$player1, $player2] = $playerRank; | |
echo "<strong>Player 1 is:</strong>", nl2br("\n"); | |
foreach ($player1 as $data) { | |
echo $data, nl2br("\n"); | |
} | |
echo nl2br("\n"); | |
echo "<strong>Player 2 is:</strong>", nl2br("\n"); | |
foreach ($player2 as $data) { | |
echo $data, nl2br("\n"); | |
} | |
echo nl2br("\n"); | |
echo "<strong>Player List:</strong>", nl2br("\n"); | |
foreach ($playerRank as [$name, $country, $elo]) { | |
echo "<strong>Player Name:</strong> $name, ", "<strong>Player Country: </strong> $country,", "<strong>Elo: </strong> $elo"; | |
echo nl2br("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment