$user['pid'] ?? '-', 'firstname' => $user['firstname'] ?? '-', 'lastname' => $user['lastname'] ?? '-', 'email' => $user['email'] ?? '-', 'Department' => $user['custom_field_1'] ?? '-', // Example, adjust as needed 'Designation' => $user['custom_field_2'] ?? '-', // Example, adjust as needed 'work_phone' => $user['work_phone'] ?? '-', 'Company' => $user['company'] ?? '-' ]; }, $response['items']); // Filter the user list to get the user with pid='sugeorg' $user_details_fetch = array_filter($user_list, function($user) { $_SESSION["PID_TEST"]=$_POST['pid']; return $user['pid'] === $_POST['pid']; }); } } ?>