the code:
if ($conn = fsockopen ("whois.crsnic.net", 43)) {
fputs($conn, $domain."\r\n");
while(!feof($conn)) {
$output .= fgets($conn,128);
}
fclose($conn);开发者_运维问答
now,i want to put the output of $conn
and $output
in two text file. how shoud i do? thank you.
You can't really write the contents of $conn, as it's a resource handler, however you can write the contents of $output to a file:
file_put_contents('filename', $output);
精彩评论