ホームページ >バックエンド開発 >PHPチュートリアル >fputs()出现错误怎么处理
fputs()出现异常怎么办?
页面提示:
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Warning: fputs() expects parameter 1 to be resource, boolean given in x.php on line 100Warning: feof() expects parameter 1 to be resource, boolean given in x.php on line 101Warning: fgets() expects parameter 1 to be resource, boolean given in x.php on line 102
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> $data = ""; $text = "xawasdf"; $server = "abc.com"; $fp = fsockopen($server, 43, $errNo, $errStr, 10); fputs($fp, $text. "\r\n"); //100行 while (!feof($fp)) { //101行 $data .= fgets($fp, 128); //102行 } fclose($fp);