PHP code example of garak / card
1. Go to this page and download the library: Download garak/card library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
garak / card example snippets
arak\Card\Card;
use Garak\Card\Rank;
use Garak\Card\Suit;
$card = new Card(new Rank('A'), new Suit('d'));
echo $card; // will output "Ad"
$card = new Card(new Rank('7'), new Suit('s'));
echo $card->toText(); // will output "7♠"
$card = Card::fromRankSuit('Kh');
echo $card->toUnicode(); // will output "🂾"
arak\Card\Card;
$orderedCards = Card::getDeck();
$shuffledCards = Card::getDeck(true);
$doubleDeckWithJokers = Card::getDeck(true, 2, true);