Folder reorganize 1
This commit is contained in:
24
test/aitest.php
Normal file
24
test/aitest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
ping network device using php and display results in a table
|
||||
|
||||
```
|
||||
<?php
|
||||
$ip = "192.168.0.11"
|
||||
|
||||
$ip = explode("\n", $ip);
|
||||
echo "<table><tr><th>IP</th><th>Result</th></tr>";
|
||||
foreach ($ip as $ip) {
|
||||
$output = shell_exec("ping -n 1 $ip");
|
||||
if (strpos($output, 'Received = 1')) {
|
||||
echo "<tr><td>".$ip."</td><td>Online</td></tr>";
|
||||
} else {
|
||||
echo "<tr><td>".$ip."</td><td>Offline</td></tr>";
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
?>
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user