Login   Register  
PHP Classes
elePHPant
Icontem

If you know an application of this package, send a message...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Checknum Class  >  All threads  >  If you know an application of this package, send a message...  >  (Un) Subscribe thread alerts  
Subject:If you know an application of this package, send a message...
Summary:I have implemented your class and want to say thank you.
Messages:1
Author:Till Wehowski
Date:2011-03-11 19:02:25
 

  1. If you know an application of this package, send a message...   Reply  
Picture of Till Wehowski
Till Wehowski
2011-03-11 19:02:28
Implementing applications: http://www.webfan.de/Convert.html#weLuhn

I added the possibillity to validate alphanumerics:
function calculate($str) {
$this->numstr = $str;
$this->wrkstr = str_replace($this->chr2rm, '', $str); // remove separators

//ALPHANUMERICS:
$this->wrkstr = str_ireplace('a', '10', $this->wrkstr);
$this->wrkstr = str_ireplace('b', '11', $this->wrkstr);
$this->wrkstr = str_ireplace('c', '12', $this->wrkstr);
$this->wrkstr = str_ireplace('d', '13', $this->wrkstr);
$this->wrkstr = str_ireplace('e', '14', $this->wrkstr);
$this->wrkstr = str_ireplace('f', '15', $this->wrkstr);
$this->wrkstr = str_ireplace('g', '16', $this->wrkstr);
$this->wrkstr = str_ireplace('h', '17', $this->wrkstr);
$this->wrkstr = str_ireplace('i', '18', $this->wrkstr);
$this->wrkstr = str_ireplace('j', '19', $this->wrkstr);
$this->wrkstr = str_ireplace('k', '20', $this->wrkstr);
$this->wrkstr = str_ireplace('l', '21', $this->wrkstr);
$this->wrkstr = str_ireplace('m', '22', $this->wrkstr);
$this->wrkstr = str_ireplace('n', '23', $this->wrkstr);
$this->wrkstr = str_ireplace('o', '24', $this->wrkstr);
$this->wrkstr = str_ireplace('p', '25', $this->wrkstr);
$this->wrkstr = str_ireplace('q', '26', $this->wrkstr);
$this->wrkstr = str_ireplace('r', '27', $this->wrkstr);
$this->wrkstr = str_ireplace('s', '28', $this->wrkstr);
$this->wrkstr = str_ireplace('t', '29', $this->wrkstr);
$this->wrkstr = str_ireplace('u', '30', $this->wrkstr);
$this->wrkstr = str_ireplace('v', '31', $this->wrkstr);
$this->wrkstr = str_ireplace('w', '32', $this->wrkstr);
$this->wrkstr = str_ireplace('x', '33', $this->wrkstr);
$this->wrkstr = str_ireplace('y', '34', $this->wrkstr);
$this->wrkstr = str_ireplace('z', '35', $this->wrkstr);

$this->wrkstr = str_ireplace('', '101', $this->wrkstr);
$this->wrkstr = str_ireplace('', '102', $this->wrkstr);
$this->wrkstr = str_ireplace('', '103', $this->wrkstr);


Regards,
Till Wehowski
Webfan.de