I am working on a site, I want the results to display alphabetically. A prevous developer has setup this code.
if(!empty($post_data)){ 
                echo '<div class="related-attorneys">
                    <h3>related attorneys</h3>
                    <ul>';                      
                    for ($i=0; $i <=end($post_keys) ; $i++) { 
                         echo '<li><a href="' .get_permalink( $post_data[$i]->ID ).'">' .$post_data[$i]->post_title. '</a></li>';
                    }
                echo '</ul></div>'; 
                }
I want to order the results based off the titles. I have tried a lot of examples but nothing seems to work. the array $post_data looks like this:
Array ( [0] => WP_Post Object ( [ID] => 4870 [post_author] => 2 [post_date] => 2017-08-08 20:39:20 [post_date_gmt] => 2017-08-08 20:39:20  [post_name] => michael-d-leedberg [post_title] => Mark J. Hoover
Any help would be appreciated.
