Sort an array by alphabetically by second word
<p>I am sorting a multidimensional array that contains peoples names and some information aobut them. I'm using <code>asort($obj)</code> to sort it alphabetically by their first names (it comes first). It works great, only now I need to sort it by their last name, rather than first. However, the name in its entirety "Joe Smith" for example is under the "name" key. I need it sorted by last name, instead of first. How can I do this?</p>

<p><strong>EDIT</strong>
It seems that I went about it in the wrong way. It ended up easiest to simply assign the first and last name from the DB to separate fields, rather than the same string.</p>
