- hexdec: documentation ( source)
- md5: documentation ( source)
<?php
$account_numbers = ["1234567890","12345678901234567890","1234567890123"];
$utility_id = 1;
foreach ($account_numbers as $accountNumber) {
//$customerNumber = str_pad($utility_id, 3, "0", STR_PAD_RIGHT);
$hexnum = hexdec(md5($accountNumber));
$smallnum = $hexnum % 10;
echo $smallnum . $PHP_EOL;
}