开发者

how to put the result in a text file?

开发者 https://www.devze.com 2023-03-31 17:50 出处:网络
the code: if ($conn = fsockopen (\"whois.crsnic.net\", 43)) { fputs($conn, $domain.\"\\r\\n\"); while(!feof($conn)) {

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消