title: how do i get local machine ip address ipv4 address when ever user visit on my website?
body: <p>how do I get local machine IP address ipv4 address whenever user visit my website on the server?</p>
  
  <pre><code>function getLocalIP(){
  exec("ipconfig /all", $output);
      foreach($output as $line){
          if (preg_match("/(.*)IPv4 Address(.*)/", $line)){
              $ip = $line;
              $ip = str_replace("IPv4 Address. . . . . . . . . . . :","",$ip);
              $ip = str_replace("(Preferred)","",$ip);
          }
      }
  return $ip;
  }
  
  echo $ip = getLocalIP(); //This will return: 192.168.x.x (Your Local IP)
  </code></pre>
  
  <p>The problem code is not showing anything?</p>