Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Validate_IR, added detailed comment on ssn.

git-svn-id: http://svn.php.net/repository/pear/packages/Validate/trunk@309410 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit 1a59ac14e5e0fafa11520de0c5faf2ae42eb889f 1 parent 95dc7e9
hemmat hemmat authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 Validate/IR.php
9 Validate/IR.php
@@ -107,7 +107,14 @@ function postalCode($check)
107 107 }
108 108
109 109 /**
110   - * Checks social security numbers for Iran called "kode melli"
  110 + * Checks social security numbers for Iran called "kode melli".
  111 + * kode melli's last digit from left is the check digit, here is the algorithm:
  112 + * A= last digit from left
  113 + * B= (first digit*10) + (2th digit*9) + ... (9th digit *2)
  114 + * C= B – (B/11)*11
  115 + * if C==0 and A==0 OK
  116 + * if C==1 and A==1 OK
  117 + * if C>1 and A==(C-11) OK
111 118 *
112 119 * @param string $check The value to check.
113 120 *

0 comments on commit 1a59ac1

Please sign in to comment.
Something went wrong with that request. Please try again.