Get title of a post in WordPress

get_the_title($ID); is used to get a title of a post in WordPress. This method can take in an integer argument where you can specify the Post ID or you can leave it empty to use the current post in the loop.

<?php echo get_the_title($ID); ?>
//uses post id

<?php echo get_the_title(); ?>
// uses current post