Add snap() method to return 1 item with Extract from Array
Closed this issue · 0 comments
roberto-butti commented
In Draw class, extract method returns a sub array.
In order to retrieve just 1 value from original array add snap() method.
In order to retrieve just 1 key from original array add snapKey() method.
Example usage:
use HiFolks\RandoPhp\Draw;
$randomLanguage = Draw::sample(["PHP", "Python", "Golang", "Javascript"])->snap();
var_dump($randomLanguage);