How to add item to cart programmatically, with attributes in Ubercart So I know how to go about adding an item to the cart with PHP like this;

$product_nid = 2;
$some_data = NULL;

  uc_cart_empty(uc_cart_get_id());

  $data = serialize($some_data);

  uc_cart_add_item($product_nid, $qty = 1, $data, $cid = NULL, $msg = TRUE, $check_redirect = TRUE, $rebuild = TRUE);


but I'm uncertain how to add a product with a certain attribute/option such as if I have product "A" with options "1" and "2" I was hoping I could get a little help.
This is for Drupal 7, Ubercart 3.
Taking Chris's answer an putting it in Answer format for readability.

Figured it out, perhaps this will be of help for someone :)

$product_nid = 2;  
$some_data = array('attributes' =&gt; array( 
                   '1' =&gt; '1', 
                  ),
             );
uc_cart_empty(uc_cart_get_id());
$data = serialize($some_data);
uc_cart_add_item($product_nid, 
                 $qty = 1,
                 $data,
                 $cid = NULL,
                 $msg = TRUE,
                 $check_redirect = TRUE,
                 $rebuild = TRUE);