how to get category from post id
snippet in php

wordpress get post by id

user9224

$post   = get_post( 123 ); // Where 123 is the ID
$output =  apply_filters( 'the_content', $post->post_content );

how to get category from post id

user389

get_the_category($post->ID)