Re: Socket functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux