How do you ping an ip addresses in php. and give the the results as if you are on cmd program in windows

<?php 


  system(‘ping -c 192.168.0.104’); // Ping IP address.

    echo “pinged”;

?>

try this:

<?php
    echo exec("ping www.google.com");
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.