Home Codeigniter How we can get Ip Address in Codeigniter Application?

How we can get Ip Address in Codeigniter Application?

by Shahriar Sagor

Today now in this post i will show you How we can get Ip Address in Codeigniter Application? If we are working on Codeigniter application and if we need to get the client ip address. I hope we can get this easy. Here we don’t need to use any $_SERVER variable as like native PHP, but in Codeigniter framework provided us $this->input. So we can easily fetch this by using the following example:

Example:

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

Read Also : Laravel 8 Mobile Number Verification Tutorial

Thanks for read. I hope it help you. For more you can follow us on facebook

close

You may also like