[KLUG Members] PHP and regular expression problem

members@kalamazoolinux.org members@kalamazoolinux.org
Thu, 30 May 2002 14:34:42 -0400


>Adam Williams wrote:
>> >It looks like the errant/missing zeros are always in the middle, why not just
>> <much deleted>
>> Unfortunately I don't know how many there should be.  While all the
>> examples are gave are of a consistent length, the integer portion of the
>> number actually varies in length.
>
>Simply put, it looks like the serial number contains several fields compounded
>together.  The solution seems to lie in separating and regularizing the field you
>want to analyze.
>You call them integers, so maybe
>intval($suffix)
>and compare on the result
>would work.

Is there a php function which will return the index order of an array that would
place it in some sorted order? If so, this problem becomes both trivial in nature
and has very general solution. I'm sure no one wants to go back and rework this
thing if the meanings, intervals or other properties change. It is desirable to
have a solution that has those properties, without getting involved in the nature
of the data.
								Regards,
								---> RGB <---