Philippe Reynolds wrote:
Greetings,

When I do an ifconfig in unix, I see the the IP address for the my ethernet. It follows something called inet.

Would anyone know who to manipulate the socket functions to be able to extract the inet IP address fromt the eth0 section??

<?php

  exec('ifconfig eth0 | grep inet',$output);
preg_match("|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|",$output[0],$matches);
  echo $matches[0];

?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to