Re: Normalized Numbers
| From: | Brian P. Giroux | Date: | Sun, 14 Jan 2007 21:40:04 +0000 |
| Subject: | Re: Normalized Numbers | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247089@lists.php.net to get a copy of this message | ||
Arpad Ray wrote:
> Have you checked out the PEAR Validate packages?
> http://pear.php.net/package/Validate_ISPN in particular might
> help you
> along ;)
I figured that someone had probably done this before. I wanted to do it
myself because I figured it's a nice simple exercise to get my feet wet,
and it's something I will probably use (unlike something from a book).
> And BTW, most servers are set up to display php files renamed to .phps
> with syntax highlighting, so give that a try instead of .php.txt next time.
This is good to know, I've tried it on the senecal.ca server a Microsoft
IIS) and it doesn't seem to work. I think I have some space on another
server, I'll have to dig up the username and password and give it a try.
> Regards,
>
> Arpad
>
> Brian P. Giroux wrote:
>> I am just learning PHP and as a practical exercise I've been working on
>> a set of functions to process and manipulate what I call "normalized
>> number" (ISBNs, EANs, UPCs, etc...)
>>
>> My ultimate goal is to create a normnum class and child classes for the
>> different types of numbers.
>>
>> Because of my line of work, I am mostly interested in ISBN-10s,
>> ISBN-13s, EANs and UPCs, but it can also be expanded to credit card
>> numbers, Canadian Social Insurance Numbers, and many more.
>>
>> So far I have functions to validate ISBN-10s and EANs although I've run
>> into a bit of a wall with the digit_sum function as explained in the B:
>> section of that functions header comments.
>>
>> If anyone can help me out with that or provide any other advice about
>> the rest of it, I'd be grateful.
>>
>> The file can be found at .ì
>> ÒÏÿÓµ£7*WØïÊhttp://www.senecal.ca/normnums.php.txt
>>
>> Thanks.
>>
--
Brian P. Giroux