sed turpis tempor luctus. Curabitur sed nibh eu elit
mollis congue. Praesent ipsum diam, consectetur vitae
ornare a, aliquam a nunc. In id magna pellentesque
tellus posuere adipiscing. Sed non mi metus, at lacinia
augue. Sed magna nisi, ornare in mollis in, mollis
sed nunc. Etiam at justo in leo congue mollis.
Nullam in neque eget metus hendrerit scelerisque
eu non enim. Ut malesuada lacus eu nulla bibendum
id euismod urna sodales. ";
$compressed = gzcompress($string);
echo "Original size: ". strlen($string)."n";
/* prints
Original size: 800
*/
echo "Compressed size: ". strlen($compressed)."n";
/* prints
Compressed size: 418
*/
// getting it back
$original = gzuncompress($compressed);
9. 使用PHP做Whois检查
function whois_query($domain) {
// fix the domain name:
$domain = strtolower(trim($domain));
$domain = preg_replace('/^http:///i', '', $domain);
$domain = preg_replace('/^/i', '', $domain);
$domain = explode('/', $domain);
$domain = trim($domain[0]);
// split the TLD from domain name
$_domain = explode('.', $domain);
$lst = count($_domain)-1;
$ext = $_domain[$lst];
// You find resources and lists
// like these on wikipedia:
//
// http://de pedia/wiki/Whois
//
$servers = array(
"biz" => "whois.neulevel",
"com" => "whois.internic ",
"us" => "whois.nic.us",
"coop" => "whois.nic.coop",
"info" => "whois.nic",
"name" => "whois.nic",
"net" => "whois.internic ",
"gov" => "whois.nic.gov",
"edu" => "whois.internic ",
"mil" => "rs.internic ",
"int" => "whois.iana",
"ac" => "whois.nic.ac",
"ae" => "whois.uaenic.ae",
"at" => "whois.ripe ",
"au" => "whois.aunic ",
"be" => "whois.dns ",
"bg" => "whois.ripe ",