how to get ip address in codeigniter? Category : Codeigniter | Updated at : 2019-02-22 04:00:38

Use

$this->input->ip_address();

Codeigniter Input User Guide (ip_address)

Also, don't echo an equation. echo on another line instead:

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