WordPress Set Category Front End

$postCats = trim( $_POST['post-cats']; )
$postCats = explode( ',', $postCats );

wp_set_object_terms( $post_id, array( $postCats[0], $postCats[1], $postCats[2], $postCats[3], $postCats[4] ), 'category' );
Fragile Flatworm