title: Getting Network Client MAC address, Syntax issue using PhP
body: <p>Actually the below coding is working fine, if I provide the ip address directly inside the <code>shell_exec()</code></p>
  
  <pre><code>$mac = shell_exec('arp -a 192.168.0.107'); 
  </code></pre>
  
  <p>If, I get the ip of the client from his system and stored in a variable and call the same, as given below,</p>
  
  <pre><code>$mac = shell_exec('arp -a' . escapeshellarg($ip));
  </code></pre>
  
  <p>The output is not generating.</p>
  
  <p>Here is the Full code:</p>
  
  <pre><code>&lt;?php
  
  $ip = $_SERVER['REMOTE_ADDR'];
  $mac = shell_exec('arp -a'. escapeshellarg($ip));
  
  //Working fine when sample client IP is provided...
  //$mac = shell_exec('arp -a 192.168.0.107'); 
  
  $findme = "Physical";
  $pos = strpos($mac, $findme);
  $macp = substr($mac,($pos+42),26);
  
  if(empty($mac))
  {
      die("No mac address for $ip not found");
  }
  
  // having it
  echo "mac address for $ip: $macp";
  
  ?&gt;
  </code></pre>
  
  <p>Please advise, why <code>escapeshellarg($ip)</code> does not work in the <code>shell_exec()</code>.</p>