SyntaxFix
Write A Post
Hire A Developer
Questions
echo '<p>'. get_the_category( $id )[0]->name .'</p>';
is what you maybe looking for.