Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello sir,
I am working androidphonegap. I want to device mac address. How to get in php and javascript. Please help me. I'm using this code.
PHP
$ipAddress=$_SERVER['REMOTE_ADDR'];
$macAddr=false;

#run the external command, break output into lines
$arp=`arp -a $ipAddress`;
$lines=explode("\n", $arp);

#look for the output line describing our IP address
foreach($lines as $line)
{
   $cols=preg_split('/\s+/', trim($line));
   if ($col[0]==$ipAddress)
   {
     $macAddr=$col[1];
   }
}

But display for ip address only.mac address how to get.
Posted
Updated 30-Aug-11 18:06pm
v2
Comments
Prerak Patel 31-Aug-11 0:06am    
Use code block to highlight the code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900