code: public static function checkPeopleArgs()
      {
          $args = func_get_args();
          if (empty($args)) {
              return array();
          }
  
          // 1 only email
          if (count($args)==1 && is_string($args[0]) && self::isEmail($args[0])) {
              return array( array($args[0]) );
          }
  
          // 2 args and 2nd is not an email
          if (
              count($args)==2 &&
              (isset($args[0]) && true===self::isEmail($args[0])) &&
              (isset($args[1]) && false===self::isEmail($args[1]))
          ) {
              return array( array( $args[1]=>$args[0] ) );
          }
  
          // a set of name=>email pairs
          if (count($args)==1) {
              $args = $args[0];
          }
          $result=array();
          foreach ($args as $name=>$email) {
              if (is_string($name) && true===self::isEmail($email)) {
                  $result[] = array( $name=>$email );
              } elseif (is_numeric($name) && true===self::isEmail($email)) {
                  $result[] = array($email);
              }
          }
          return $result;
      }
docs: Clean and build a set of name=>email pairs
  
  Arguments can be writtent as :
  ( 'my@email.address' )
  ( 'my@email.address', 'my name' )
  ( array( 'my name'=>'my@email.address' ) )
  ( array( 'my name'=>'my@email.address', 'another name'=>'another@email.address' ) )
  ( array( 'my name'=>'my@email.address', 'another@email.address' ) )
  
  @return array