Skip to content

Instantly share code, notes, and snippets.

@didats
Created November 18, 2013 02:00
Show Gist options
  • Save didats/7521234 to your computer and use it in GitHub Desktop.
Save didats/7521234 to your computer and use it in GitHub Desktop.
Civil ID Validation for Kuwait Citizen using PHP
function validate_civilid($str) {
$valid = false;
if(preg_match("/[0-9]/{12}", $str)) {
$test = ((substr($str, 0, 1) * 2) + ((substr($str, 1, 1) * 1) + ((substr($str, 2, 1) * 6) + ((substr($str, 3, 1) * 3) + ((substr($str, 4, 1) * 7) + ((substr($str, 5, 1) * 9) + ((substr($str, 6, 1) * 10) + ((substr($str, 7, 1) * 5) + ((substr($str, 8, 1) * 8) + ((substr($str, 9, 1) * 4) + ((substr($str, 10, 1) * 2) ) % 11;
if($test == substr($str, 11, 1)) $valid = true;
}
return $valid;
}
@naveen64679
Copy link

The ICP Smart Services allow you to register your arrival and departure information while applying for your Emirates ID, Residential Visa, and Visa validity in Dubai online.

@zamanalisandhu
Copy link

Now a question arises in mind, how to check its balance before leaving home? We have got you covered. You don’t need to worry because you have landed on a trusted website. Here are five easy ways to check your NOL card balance. Check online, making your journey convenient and hassle-free.

@zamanalisandhu
Copy link

The ICP Smart Services allow you to register your arrival and departure information while applying for your Emirates ID, Residential Visa, and Visa validity in Dubai online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment