function lead_by_search($name, $where = '', $msi_id = '0') { $seed_lead = new Lead(); if ($where == '') { $where = $seed_lead->build_generic_where_clause($name); } if (!$seed_lead->ACLAccess('ListView')) { return array(); } $response = $seed_lead->get_list("last_name, first_name", $where, 0); $lead_list = $response['list']; $output_list = array(); // create a return array of names and email addresses. foreach ($lead_list as $lead) { $output_list[] = get_lead_array($lead, $msi_id); } return $output_list; }