I’m wanting to sort the following array structure (the below array is print_r($glossary_index)) so that it is by length of the post_title (longest to shortest) :
Array
(
[728] => stdClass Object
(
[ID] => 728
[post_author] => 1
[post_date] => 2010-07-15 17:34:34
[post_date_gmt] => 2010-07-15 07:34:34
[post_content] => Somebody you owe money to
[post_title] => Creditor
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => creditor
[to_ping] =>
[pinged] =>
[post_modified] => 2010-07-16 11:58:28
[post_modified_gmt] => 2010-07-16 01:58:28
[post_content_filtered] =>
[post_parent] => 0
[guid] => …
[menu_order] => 0
[post_type] => glossary
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[725] => stdClass Object
(
[ID] => 725
[post_author] => 1
[post_date] => 2010-07-15 17:10:24
[post_date_gmt] => 2010-07-15 07:10:24
[post_content] => yada yada yda
[post_title] => Creditor’s Petition
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => creditors-petition
[to_ping] =>
[pinged] =>
[post_modified] => 2010-07-15 17:38:06
[post_modified_gmt] => 2010-07-15 07:38:06
[post_content_filtered] =>
[post_parent] => 0
[guid] => ...
[menu_order] => 0
[post_type] => glossary
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
)
So in the above scenario it would become:
Array
(
[725] => stdClass Object
(
[ID] => 725
[post_author] => 1
[post_date] => 2010-07-15 17:10:24
[post_date_gmt] => 2010-07-15 07:10:24
[post_content] => yada yada yda
[post_title] => Creditor’s Petition
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => creditors-petition
[to_ping] =>
[pinged] =>
[post_modified] => 2010-07-15 17:38:06
[post_modified_gmt] => 2010-07-15 07:38:06
[post_content_filtered] =>
[post_parent] => 0
[guid] => …
[menu_order] => 0
[post_type] => glossary
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
[728] => stdClass Object
(
[ID] => 728
[post_author] => 1
[post_date] => 2010-07-15 17:34:34
[post_date_gmt] => 2010-07-15 07:34:34
[post_content] => Somebody you owe money to
[post_title] => Creditor
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => creditor
[to_ping] =>
[pinged] =>
[post_modified] => 2010-07-16 11:58:28
[post_modified_gmt] => 2010-07-16 01:58:28
[post_content_filtered] =>
[post_parent] => 0
[guid] => ...
[menu_order] => 0
[post_type] => glossary
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
)