Hi I want to obtain my ip number in php, I'm using ubuntu and apache XAMPP for linux as webserver.
- Code: Select all
<?php
echo $gethostname = gethostbyname(gethostname());
?>
When I execute the code it returns 127.0.0.1 What I want is like i.e 10.151.32.123. This code works in windows with xampp, why this code doesn't work in Linux?