which of the following is the correct way to assign a category to a wordpress post

Choose the correct option

which of the following is the correct way to assign a category to a wordpress post?

  1. wp_set_post_categories($postid,$categories)
  2. wp_set_category($catid,$postid)
  3. by xml-rpc call to wpc.newpost
  4. this is not possible

The correct answer:

wp_set_post_categories($postid,$categories)

for more go to wordpress