Skip to content

Instantly share code, notes, and snippets.

@didats
Created November 18, 2013 02:00
Show Gist options
  • Select an option

  • Save didats/7521234 to your computer and use it in GitHub Desktop.

Select an option

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;
}
@Mariaakmal
Copy link

Easily check your Nol Card Balance with just a few clicks. Keep your journeys hassle-free and stay updated!

@Salma12-prog
Copy link

"Great article! This is really helpful for understanding [topic of the blog]. For detailed guidance on Kuwait's government services, appointments, and more, visit https://meta-kuwait-portal.com/ for comprehensive resources. Keep up the great content!"

@Topwebpartners
Copy link

I am trying to attain that for https://dubaimetrolineae.com/nol-card-balance-check/ for NOL Card Balance check

@aleenm860
Copy link

I am trying to attain that for https://dubaimetrolineae.com/nol-card-balance-check/ for NOL Card Balance check

i wish you best of Luck, For NOL Card balance Check

@Obaama07
Copy link

Obaama07 commented Jul 3, 2025

Really useful function for ID validation, especially when working on systems involving structured numbers like civil IDs or travel cards. I recently came across a helpful resource on NOL card balance. Check online covers multiple ways to check smart card balances in Dubai. Might be handy if you're building anything transport-related.

@fixmyspeakerss
Copy link

Dampen a cotton swab or microfiber cloth with a bit of rubbing alcohol and gently clean the ear speaker cleaner sound grills. This method removes tough oils and disinfects them. Just be careful not to let too much moisture in to prevent damage.

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