# PHP Spell & Say # kyoorius@datawhorehouse.com # 1/16/2002 if ($sentence) { $sentence=strtolower(stripslashes(urldecode($sentence))); #$sentence=preg_replace("/\W/"," ",$sentence); $words=explode(" ",$sentence); $say=urlencode(array_shift($words)); $rest=implode(" ",$words); $requesturl="http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=$say"; $content=implode("",file($requesturl)); if ($start=strpos($content,"audio.pl?")) {; $start+=9; $end=strpos($content,"=",$start); $wav=substr($content,$start,$end-$start); $url="http://cougar.eb.com/sound/".substr($wav,0,1)."/".$wav; } } ?>
if ($url) { ?>
}
print "$requesturl
$url
";?>