How to pass seperate contextual filter values to a view and get results programatically? I've a view having two (separate) contextual filters, say node id and taxonomy id. We can pass separate contextual filter values with a "/". example: 12,13,14/8,9 as URL arguments.

But how can we get the view results by passing the dynamic contextual filter values to the view?
Here we go.

 $nodes_str = implode(',', $nids); // $nids is an dynamic array.
 $args[] = $nodes_str; // First contextual filter argument. 12,13,14.. etc
 $args[] = $tag; // Second contextual filter arguments 8,9.. etc
 $view = views_get_view('view_machine_name');
 $view-&gt;set_display('display_name');
 $view-&gt;set_arguments($args);
 $view-&gt;pre_execute();
 $result = $view-&gt;execute();
 $output = $view-&gt;result;


If need futher details of the view parameters. You can debug the values using the hook_views_pre_view()

function YOUR_MODULE_views_pre_view(&amp;$view, &amp;$display_id, &amp;$args) {

}


Hope this helps someone.