My Account | Buy CometChat

documentation

$userid

The API

$userid is a global variable which returns the user ID of the logged in user. If the user is not logged in, the value will be 0.

Sample Code

include_once (cometchat/cometchat_init.php);
echo $userid;