nelsonmhjr (owner)

Forks

Revisions

gist: 228121 Download_button fork
public
Public Clone URL: git://gist.github.com/228121.git
Embed All Files: show embed
ping_test.php #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
echo '<pre>';
 
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
 
$last_line = system('ping localhost -c1', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
 
echo '<pre>';
$last_line = system('ping www.google.com -c1', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
 
echo '<pre>';
$last_line = system('ping 200.200.200.200 -c1', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
 
echo '<pre>';
$last_line = system('ping www.askdjfoajsdofijoasdnh.com.br -c1', $retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?>