Load Multiple Arguments to a View with PHP Code I have a view that I am setting up that will be the view used to select users from a user reference field. I want to build the view so that it only allows the user to reference users that are referenced by a node that this node is referring to. 

To Illustrate:

Node Type A => References different users with separate user reference fields (not multi-value fields)

Node Type B => References Node Type A, AND will only reference users that are currently referenced in Node Type A 

So I am trying to provide an array of default arguments using PHP in Views. Here's what I have so far:

$node = node_load(arg(1));

if($node) {
$users = array(
'am' =&gt; $node-&gt;field_am_reference[0]['uid'],
'realtor' =&gt; $node-&gt;field_realtor_reference[0]['uid'],
);
  foreach($users as $user) { 
  return  $user;
   }

} 
else {
return FALSE;
}


The Node Type B form is embedded into Node Type A's node view in the .tpl file, so I am loading Node Type A's nid from the url...this is working, but I am only getting the first user reference ('am') field to show up in the checkbox list that is used for the user reference options for Node Type B's  embedded form.
Okay...Here's the right way to do it. I was running into a problem with empty key values. I had to create the array out of the user reference fields I wanted, scrape any of the empty array keys  

$node = node_load(arg(1));

if($node ) {
$user_args = array(
$node-&gt;uid,
$node-&gt;field_am_reference[0]['uid'],
$node-&gt;field_realtor_reference[0]['uid'],
$node-&gt;field_title_rep_reference[0]['uid']

);
//Remove empty array values and thier respective keys 
  $clean_args = array_filter($user_args, 'strlen'); 

//Take all of the array values and put them into a single key 
  $safe_args = implode(',' , $clean_args);

return $safe_args;
}



else  {

return FALSE;

}