1. Go to this page and download the library: Download likewinter/card-deck 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/ */
likewinter / card-deck example snippets
use Likewinter\CardDeck\{DeckBuilder, Stack, Table};
// Build a standard 52-card deck and shuffle it
$deck = DeckBuilder::standard52()->build();
$table = new Table(deck: $deck, shuffle: true);
// Deal 5 cards to each of 3 players
$table->addHand('alice', new Stack(capacity: 5));
$table->addHand('bob', new Stack(capacity: 5));
$table->addHand('carol', new Stack(capacity: 5));
$table->drawAll(5);
echo "Alice: {$table->hand('alice')}\n"; // Alice: A♣,K♦,Q♥,J♠,10♣