PHP Code Snippet to Declare a Variable and Fetch Data for the Currently Logged-in User

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000095727-php-code-snippet-to-declare-a-variable-and-fetch-data-for-the-currently-logged-in-user

The code snippet below will declare a variable for currently logged-in users. This variable will then hold the user data fetched from the system.

<?php
// Declare variable for the currently logged-in user
$loggedInUser = getUser($_COOKIE['userid'], $w);
?>