$result = implode("", file("ty.txt");

解决方案 »

  1.   

    可是在php中,下面这些语句有作用吗?这是asp的格式,php的格式是怎样的?
      Set fs = Server.CreateObject("Scripting.FileSystemObject")
      set inf = fs.OpenTextFile(Server.MapPath("ty.txt"), 1, False)  Do While not inf.AtEndOfStream
      

  2.   

    原代码等价与
    function GenQueryString() {
      $fp = fopen("ty.txt","r");
      $result = "";
      while(! feof($fp)) {
        $result .= fgets($fp,4094);
      }
      fclose($fp);
      return $return;
    }