I am creating a project. Now I want the IP address of the guest who are unauthorized person.
Try this
<?php $ip = $_SERVER['REMOTE_ADDR']; ?>
try this one $_SERVER['REMOTE_ADDR']
you can also check here for more info How to get the client IP address in PHP?