function pipe_streams($in, $out) { $size = 0; while (!feof($in)) $size += fwrite($out,fread($in,8192)); return $size; }