WordPress get slug by id function

Neath little function to return a post slug by id wordpress
function the_slug($id) {
$post_data = get_post($id, ARRAY_A);
$slug = $post_data['post_name'];
return $slug; 
}