How to Get IP Address in Codeigniter?

By Hardik Savani November 5, 2023 Category : Codeigniter

Hi Developer,

In this example, I will show you codeigniter get ip address. I explained simply about codeigniter 4 get ip address. you will learn codeigniter 3 get ip address. you will learn how to get ip address in codeigniter. Alright, let us dive into the details.

If you are work on Codeigniter application and you require to get client ip address then you can get easy. you don't need to use $_SERVER variable like native PHP, but Codeigniter provide $this->input. you can fetch easy using following example:

Example:

$ip = $this->input->ip_address();

print_r($ip);

I hope it can help you...

Tags :
Shares