12/01/2016 - PHP
Simple function below generates credit card like random IDs.
function getCreditCardNumbers($segments = 4) {
$numbers = [];
for ($i = 0; $i < $segments; $i++) {
$numbers[] = mt_rand(1000, 9999);
}
return implode('-', $numbers);
}
echo getCreditCardNumbers();
5951-9961-7050-7183
8402-4921-5497-9251
9986-3340-7152-2866