Thanks for your answer deathshadow60. i will try this approach.
that is the ip address assign by some isp provider like if we go to What Is My IP Address? Lookup IP, Hide IP, Change IP, Trace IP and more… it will show the ip address provided by isp. my local ip 10.0… if i run my script under my local ip it return 10.0… i want to return ip address provided by isp.
That statement still makes no sense… I’m wondering if we have a terminology issue or something here. What do you mean “run it on my local IP”? Are you talking a local server like XAMPP or something? Something on your WAN that isn’t exposed on the other side of your router?
Either 1) you have the most bizzare hardware setup I’ve ever heard of, 2) you’re failing to grasp how this stuff works – or 3) I’m COMPLETELY missing your meaning entirely.
$domainPath[0] should then be either the IP address OR the domain name depending on the request type . If you NEED the IP address, test if it’s a valid IP addy (another explode and four is_numeric?), if it isn’t, then call gethostbyname.
You are getting a local IP address because you are connecting to the server from a local IP address.
I assume you are wanting the IP address of your domain name, correct?
Could you explain better? I can’t even make sense out of your post.
SERVER_ADDR should be giving you the IP address of wherever that PHP code is being run – aka the server it’s being run from/on, not the client… The phrase “IP address in the URL” makes no sense whatsoever…well, unless you’re calling the IP addy instead of by domain name…