John,

JWH> The best solution I see is to start building yourself some
JWH> arrays...

Looks like a sensible approach, at least for the kind of rough and
ready solution I need.

My only comment would be to make use of the placement of the words. If
the names are fielded ( first_name, middle_name, last_name ) then you
could apply different rules to each, as appropriate. If the full name
is in one string, you could make intelligent guesses: ie

If wordcount == 1, last_name = word_1

if wordcount == 2
{
   if word2 is a roman number, last_name = $word1
   else last_name = $word2
}

if wordcount = 3
{
   Check for roman numbers
   Check for multiple low case middle names ( de la Rue )
   Else word1 = first_name, last word is last_name, middle word(s) =
   middle names
}

And so on. I'm simplifying, but you get the idea.
I'll hack something together in the next few days and post it.

Any farther ideas welcome, though.

Geoff Caplan
Advantae Ltd


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to