ac massa 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(''/^www\./i'', '''', $domain); $domain = explode(''/'', $domain); $domain = trim($domain[0]); // split the TLD from domain name
十个超级有用的PHP代码片段 _网学