Which is the best way to access client ip in php ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Which is the best way to access client ip in php ?

24th Jan 2017, 6:22 PM
Alwin Joseph
2 Answers
+ 1
$_SERVER array is your friend here. However depending on the configuration of the webserver, this information might not be available.
24th Jan 2017, 7:53 PM
Tomas Hampl
Tomas Hampl - avatar
+ 1
$_SERVER['REMOTE_ADDR']
24th Jan 2017, 8:26 PM
Shubham Surya
Shubham Surya - avatar