Re: [PHP] Re: Sort a text string by last word before separator

2004-06-24 Thread Andre Dubuc
Thanks Torben, I've been messing about with code all afternoon, and my mind is blitzed. Didn't think it was possible since there was no way I could access the first name part (after I accessed the surname) since it had no delimiter except spaces. Managed to get the surname in a sorted array, bu

[PHP] Re: Sort a text string by last word before separator

2004-06-24 Thread Lars Torben Wilson
Lars Torben Wilson wrote: Sorry about following up to myself, but I was really really hungry when I wrote the first one: [snip] This code returns the names in the format in which they are given. You can speed it up a bit by having it return the names in 'lastname, firstname' format. For this, chan

[PHP] Re: Sort a text string by last word before separator

2004-06-24 Thread Lars Torben Wilson
Andre Dubuc wrote: Given a text string: $OK = "Joe Blow, William Howard Anser, Hannie Jansen, etc, etc,"; [snip] How would I get this 'before_last' function to iterate through the initial string, so I could build a sorted list with both first and last names, sorted by last name? I can't seem to g