ipCheck (function)

Last updated: Mon, Apr 17, 2023 10:49 am
Return to Knowledgebase

Purpose

Used to get the IP address of the user accessing the website.

Location

users/helpers/us_helpers.php

Parameters

This function does not take any arguments

Returns

Data Type Description of Returned Data
string returns the IP address of the user accessing the website

Further Documentation:

The ipCheck() function in UserSpice is used to get the IP address of the user accessing the website. It does this by accessing the REMOTE_ADDR server variable which contains the IP address of the client making the request.

Function Signature:

function ipCheck() : string


Example Usage:

$user_ip = ipCheck();
echo "Your IP address is: " . $user_ip;