title: Get Wordpress post title in array
body: <p>I want to have Wordpress post title in array.</p>
  
  <p>I have my post titles in my custom post type as names of people with their surnames. I want to display my posts based alphabetically on their surnames and store it in an array. How do I do this in the loop?</p>