32 lines
629 B
PHP
32 lines
629 B
PHP
<?php
|
|
|
|
include "db.php";
|
|
|
|
$query = "SELECT school_name, url FROM schools WHERE status IN ('Active','Linked','Special')";
|
|
$schools = db_query($query);
|
|
|
|
$domains = array();
|
|
|
|
while ($row = db_fetch_assoc($schools)) {
|
|
extract($row);
|
|
list($code,$domain) = explode(".",$url,2);
|
|
if (strpos($domain,'.') == 0) $domain = $url;
|
|
if (strlen($domain) == 0) continue;
|
|
|
|
if (array_key_exists($domain,$domains)) {
|
|
$domains[$domain]++;
|
|
}
|
|
else {
|
|
$domains[$domain] = 1;
|
|
}
|
|
}
|
|
|
|
ksort($domains);
|
|
asort($domains,SORT_NUMERIC);
|
|
|
|
foreach ($domains AS $domain => $count) {
|
|
printf("%-30s: %3d\n",$domain,$count);
|
|
}
|
|
|
|
?>
|