-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

* and then Jason Wong declared....
> If that is what you want then:
> while (names) {
>   explode the name
>   if there is more than one element swap it, then join
>   add this processed name onto a new array
> }
> 
> use one of the array sort functions to sort the new array.

Yep, cheers Jason, here's what I came up with 

function sort_teachers() {

    global $teach;

    $array_2_sort=array();

    foreach($teach->list_teachers() as $key => $val) {
        $split=explode(" ", $val["name"]);
        $array_2_sort[$key]=end($split);
    }
    asort($array_2_sort);
    return($array_2_sort);
}
- -- 
Nick Wilson     //  www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE83toJHpvrrTa6L5oRApkiAJ0YwgusbS4uBaJWOo2eory16FnM7ACfcPS0
JXjm2JXTWeN22KTs7dJwrWI=
=Z7zE
-----END PGP SIGNATURE-----

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

Reply via email to