views:

45

answers:

2

I use this to pull values from a custom field with several values:

<?php  $mykey_values = get_post_custom_values('services');
    foreach ( $mykey_values as $key => $value ) {
    echo "<li> $value</li>";
    } ?>

I want to sort the output according to the way I have set up the values in the key (alphabetically)

A: 

Have you looked at this?

LucaB
A: 
$mykey_values = get_post_custom_values('services');
sort($mykey_values, SORT_STRING);
echo "<ul>\n<li>" . implode('</li><li>', $mykey_values) . "</li>\n</ul>";

Documentation for get_post_custom_values() and sort().

artlung
Thanks - problem solved
Thomas