芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/vendor/fakerphp/faker/src/Faker/Provider/fr_FR/Person.php
numberBetween(1, 2); } $nir .= // Year of birth (aa) $this->numerify('##') . // Mont of birth (mm) sprintf('%02d', $this->numberBetween(1, 12)); // Department $department = key(Address::department()); $nir .= $department; // Town number, depends on department length if (strlen($department) === 2) { $nir .= $this->numerify('###'); } elseif (strlen($department) === 3) { $nir .= $this->numerify('##'); } // Born number (depending of town and month of birth) $nir .= $this->numerify('###'); /** * The key for a given NIR is `97 - 97 % NIR` * NIR has to be an integer, so we have to do a little replacment * for departments 2A and 2B */ if ($department === '2A') { $nirInteger = str_replace('2A', '19', $nir); } elseif ($department === '2B') { $nirInteger = str_replace('2B', '18', $nir); } else { $nirInteger = $nir; } $nir .= sprintf('%02d', 97 - $nirInteger % 97); // Format is x xx xx xx xxx xxx xx if ($formatted) { $nir = substr($nir, 0, 1) . ' ' . substr($nir, 1, 2) . ' ' . substr($nir, 3, 2) . ' ' . substr($nir, 5, 2) . ' ' . substr($nir, 7, 3) . ' ' . substr($nir, 10, 3) . ' ' . substr($nir, 13, 2); } return $nir; } }