note 55007 deleted from function.preg-split by tularis
| From: | tularis@php.net | Date: | Thu, 03 May 2007 22:25:55 +0000 |
| Subject: | note 55007 deleted from function.preg-split by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126179@lists.php.net to get a copy of this message | ||
Note Submitter: RichardWalton1978@hotmaildotcom
----
I have been searching for a method to get the IP details from a unix based (solaris) interface and
found this to be useful.
$devicen = "iprb1";
$temp = preg_split("/[\s]+/",shell_exec("/sbin/ifconfig $devicen | /bin/grep
\"inet\""), -1, PREG_SPLIT_NO_EMPTY);
$ipaddress = $temp[1];
$netmask = $temp[3];
$gateway = $temp[5];
print_r ($temp);
print "<BR>This is the current IP Address: $ipaddress<BR>
this is the current netmask: $netmask<BR>
this is the current default gateway $gateway<BR>";