generator->parse($format)); } /** * Generates valid czech IČO * * @see http://phpfashion.com/jak-overit-platne-ic-a-rodne-cislo * @return string */ public function ico() { $ico = static::numerify('#######'); $split = str_split($ico); $prod = 0; foreach (array(8, 7, 6, 5, 4, 3, 2) as $i => $p) { $prod += $p * $split[$i]; } $mod = $prod % 11; if ($mod === 0 || $mod === 10) { return "{$ico}1"; } elseif ($mod === 1) { return "{$ico}0"; } return $ico . (11 - $mod); } }