374 |
miho |
1 |
<h1> DNS Records for MLAB </h1> |
|
|
2 |
<pre> |
|
|
3 |
<?php |
|
|
4 |
// Vytáhni informace z DNS programem "host" |
|
|
5 |
if(isset($x)) unset($x); |
|
|
6 |
@Exec("host -a -l mlab.cz. ns.forpsi.cz",$x); |
|
|
7 |
//echo implode("\n",$x); |
|
|
8 |
|
|
|
9 |
// Ukousni začátek až po sekci odpovědi |
|
|
10 |
reset($x); |
|
|
11 |
while($y=each($x)) |
|
|
12 |
{ |
|
|
13 |
if(eregi(";; ANSWER SECTION:",$y[value])) break; |
|
|
14 |
} |
|
|
15 |
$x=array_slice($x,$y[key]+1); |
|
|
16 |
|
|
|
17 |
// Použij až po první prázdnou řádku |
|
|
18 |
reset($x); |
|
|
19 |
while($y=each($x)) |
|
|
20 |
{ |
|
|
21 |
if(eregi("^$",$y[value])) break; |
|
|
22 |
} |
|
|
23 |
$x=array_slice($x,0,$y[key]); |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
// Setřiď |
|
|
27 |
function sortf($a,$b) |
|
|
28 |
{ |
|
|
29 |
$a=preg_split("/\s+/",$a,4); |
|
|
30 |
$b=preg_split("/\s+/",$b,4); |
|
|
31 |
return strcmp($b[3],$a[3]); |
|
|
32 |
} |
|
|
33 |
usort($x,"sortf"); |
|
|
34 |
|
|
|
35 |
// Výsledek |
|
|
36 |
$x=implode("\n",$x); |
|
|
37 |
if ($x=="") $x="No Data\n"; |
|
|
38 |
echo $x; |
|
|
39 |
?> |
|
|
40 |
</pre> |