Re: Socket functions
| From: | Burhan Khalid | Date: | Tue, 30 Aug 2005 06:49:22 +0000 |
| Subject: | Re: Socket functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-221565@lists.php.net to get a copy of this message | ||
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]; ?>