The code example as stated has a missing '.', causing a syntax error if it is pasted and executed without being checked.
Correct Code:
<?php
$asn = geoip_asnum_by_name('www.example.com');
if ($asn) {
echo 'The ASN is: ' . $asn;
}
?>