<html>
<head>
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<?php
// Declare the suits
$suits = array (
"Spades", "Hearts", "Clubs", "Diamonds"
);
// Declare the faces
$faces = array (
"Two"=>2, "Three"=>3, "Four"=>4,
"Five"=>5, "Six"=>6, "Seven"=>7,
"Eight"=>8, "Nine"=>9, "Ten"=>10,
"Jack"=>10, "Queen"=>10, "King"=>10,
"Ace"=>11
);
// create deck array
// get all suits which has
foreach($suits as $suit) {
// get all the keys frok faces
// now
$keys = array_key($faces):
// loop through the keys as faces
foreach ($keys as $face) {
// declare the deck array
$deck = ['face' => $face, 'suit' => $suit];
var_dump($deck);
foreach($faces as $face => $value) {
$deck = ['face' => $face, 'suit' => $suit ];
}
var_dump($deck);
}
- Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.44, 5.5.24 - 5.5.28, 5.6.7 - 5.6.12
- Parse error: syntax error, unexpected ':' in /in/UHJ4k on line 30
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected ':' in /in/UHJ4k on line 30
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/UHJ4k on line 30
Process exited with code 255.
preferences:
229.34 ms | 1395 KiB | 145 Q