ARP command

Discussion in 'PHP' started by jayanthan, Jul 9, 2008.

  1. #1
    Hai all,
    I am working on to get all the ip ,physical address,etc, of all the clients connected to my Linux server,I am Controlling my server from remote through PHP pages and i tried Linux command 'ARP' which gives all the details i needed but when i exec it in php its gives me the following output:


    <?php
    $command = "arp -a";
    exec($command,$output,$returnValue);
    echo $output;
    echo $returnValue;
    $length = count($output);
    echo $length;
    ?>


    It Gives me this output:confused:

    Array
    127
    0

    So,this returns me an array of length 0,so i am unable to get any element out of it,Some one please help me out of this issue, i am struck up with this issue for half-a-day.

    I also tried with:
    print_r(exec($command,$output,$returnValue));
     
    jayanthan, Jul 9, 2008 IP