Re[2]: [PHP] Switching First & Last Names in List

From: Date: Tue, 16 Mar 2004 16:27:06 +0000
Subject: Re[2]: [PHP] Switching First & Last Names in List
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-180563@lists.php.net to get a copy of this message
Hello Ben, Tuesday, March 16, 2004, 4:16:01 PM, you wrote: BR> This works rather nicely, too: [snip] BR> $name_array is now a multi-dimensional array with the first and last BR> names separated. print_r should show you the values. It doesn't reverse the name (as required), which although you could say "give me element 1 of each array to get the lastname", this doesn't work with names such as "firstname middlename lastname" (like the OP requested) :) because now the lastname is in element 2 so you'll have to do some extra checking malarky to get it. But yeah, there are a few million ways to skin this cat. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html

« previous php.general (#180563) next »