$out = "" and then $out. = with direct $out = What's the difference there are examples below
PHP Code
$fp = @fsockopen ($whoisserver, $port, $errno, $errstr, $timeout) or Die ("Socket Error". $errno. " - " . $ERRSTR); Fputs ($FP, $domain. "\ r \ n"); $out = ""; while (!feof ($fp)) {$out. = fgets ($fp);} Fclose ($FP);
Ask here.
PHP Code
$out = ""; while (!feof ($fp)) {$out. = fgets ($fp);}
to the
PHP Code
while (!feof ($fp)) {$out = Fgets ($fp);}
There's no difference.
------Solution--------------------
Initialization operation, if not initialized $out type is null, unlike the string you want, you can var_dump look at
If you use $out to make conditional judgments, you may get unpredictable results if you do not initialize them.
------Solution--------------------
$out = "";
while (!feof ($fp)) {$out. = fgets ($fp);}
Can fetch all the contents of the $fp file
$out = "";
while (!feof ($fp)) {$out = Fgets ($fp);}
The last line of the $fp file is taken