How we can get Ip Address in Codeigniter Application?

Share Me
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

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

About code chef

My name is Shahriar sagor. I'm a developer. I live in Bangladesh and I love to write tutorials and tips that will help to other Developer's. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.

View all posts by code chef →