Hướng dẫn readfile php - đọc tệp php

(Php 4, Php 5, Php 7, Php 8)

readfile - xuất ra một tệpOutputs a file

Sự mô tả

readfile (Chuỗi $filename, bool $use_include_path = false,? Tài nguyên $context = null): int | false(string $filename, bool $use_include_path = false, ?resource $context = null): int|false

Thông số

filename

Tên tệp đang được đọc.

use_include_path

Bạn có thể sử dụng tham số thứ hai tùy chọn và đặt nó thành true, nếu bạn cũng muốn tìm kiếm tệp trong bao gồm_path.true, if you want to search for the file in the include_path, too.

________số 8

Một tài nguyên luồng ngữ cảnh.resource.

Trả về giá trị

Trả về số byte được đọc từ tệp thành công hoặc false khi thất bạifalse on failure

Errors/Exceptions

Sau khi thất bại, một $use_include_path0 được phát ra.$use_include_path0 is emitted.

Ví dụ

Ví dụ #1 buộc tải xuống bằng readfile ()readfile()

$use_include_path1

$use_include_path2

$use_include_path3

Ví dụ trên sẽ xuất ra một cái gì đó tương tự như:

Ghi chú

Ghi chú::

ReadFile () sẽ không trình bày bất kỳ vấn đề bộ nhớ nào, ngay cả khi tự gửi các tệp lớn. Nếu bạn gặp lỗi ngoài bộ nhớ, đảm bảo rằng bộ đệm đầu ra sẽ tắt bằng ob_get_level (). will not present any memory issues, even when sending large files, on its own. If you encounter an out of memory error ensure that output buffering is off with ob_get_level().

Mẹo

Một URL có thể được sử dụng như một tên tệp với chức năng này nếu các giấy gói fopen đã được bật. Xem fopen () để biết thêm chi tiết về cách chỉ định tên tệp. Xem các giao thức và trình bao bọc được hỗ trợ để biết các liên kết đến thông tin về những khả năng mà các trình bao bọc khác nhau có, ghi chú về việc sử dụng của chúng và thông tin về bất kỳ biến được xác định trước mà họ có thể cung cấp.fopen() for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.

Xem thêm

  • fpassthru () - đầu ra tất cả dữ liệu còn lại trên con trỏ tệp
  • file () - đọc toàn bộ tệp vào một mảng
  • fopen () - Mở tệp hoặc URL
  • Bao gồm - bao gồm
  • yêu cầu - yêu cầu
  • ảo () - Thực hiện yêu cầu phụ Apache
  • file_get_contents () - Đọc toàn bộ tệp thành một chuỗi
  • Các giao thức và giấy gói được hỗ trợ

riksoft tại gmail dot com

8 năm trước

$use_include_path4

$use_include_path5

$use_include_path6

$use_include_path7

$use_include_path8

Simbiat tại Outlook Dot Com ¶

1 năm trước

$use_include_path9

yura_imbp tại mail dot ru ¶

14 năm trước

false0

false1

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

false3

false4

false5

false6

Hayley Watson ¶

15 năm trước

false7

false8

false9

$use_include_path8

Marro tại email dot cz ¶

14 năm trước

$context1

$context2

$context3

$context4

$use_include_path8

flobee tại gmail dot com ¶

14 năm trước

$context6

flobee tại gmail dot com ¶

14 năm trước

$context7

$context8

$context9

null0

null1

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

null3

null4

null5

null6

Hayley Watson ¶

15 năm trước

14 năm trước

null8

null9

filename0

filename1

flobee tại gmail dot com ¶

17 năm trước

filename2

filename3

$use_include_path8

Hayley Watson ¶

17 năm trước

filename5

filename6

filename7

filename8

Hayley Watson ¶

15 năm trước

Marro tại email dot cz ¶

use_include_path0

use_include_path1

use_include_path2

use_include_path3

use_include_path4

$use_include_path8

Âm sắc ¶

17 năm trước

use_include_path6

Hayley Watson ¶

15 năm trước

Marro tại email dot cz ¶

Âm sắc ¶

17 năm trước

use_include_path8

use_include_path9

true0

true1

$use_include_path8

Hayley Watson ¶

17 năm trước

true3

true4

true5

true6

true7

true8

true9

context0

filename8

context2

context3

filename8

context5

context6

context7

$use_include_path8

Hayley Watson ¶

8 năm trước

context9

false0

false1

false2

false3

false4

false5

false6

false7

false8

false9

Hayley Watson ¶

15 năm trước

Marro tại email dot cz ¶

$use_include_path01

$use_include_path02

$use_include_path03

$use_include_path8

Âm sắc ¶

Levhita tại Gmail Dot Com ¶

$use_include_path05

$use_include_path06

$use_include_path8

Paulinator ¶

14 năm trước

$use_include_path08

$use_include_path09

$use_include_path10

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

$use_include_path12

$use_include_path13

$use_include_path14

$use_include_path15

$use_include_path16

$use_include_path17

Hayley Watson ¶

15 năm trước

$use_include_path18

$use_include_path19

$use_include_path20

$use_include_path21

$use_include_path22

$use_include_path8

Marro tại email dot cz ¶

1 năm trước

$use_include_path24

yura_imbp tại mail dot ru ¶

14 năm trước

$use_include_path25

$use_include_path26

$use_include_path27

$use_include_path28

$use_include_path29

$use_include_path30

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

$use_include_path32

$use_include_path33

$use_include_path8

Hayley Watson ¶

Marro tại email dot cz ¶

$use_include_path35

$use_include_path36

$use_include_path37

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

$use_include_path39

$use_include_path40

$use_include_path41

$use_include_path42

$use_include_path43

$use_include_path44

$use_include_path8

flobee tại gmail dot com ¶

17 năm trước

$use_include_path46

$use_include_path47

$use_include_path48

$use_include_path49

$use_include_path8

Hayley Watson ¶

17 năm trước

$use_include_path51

$use_include_path52

$use_include_path53

$use_include_path54

$use_include_path55

flobee tại gmail dot com ¶

8 năm trước

$use_include_path56

$use_include_path57

$use_include_path58

Simbiat tại Outlook Dot Com ¶

15 năm trước

$use_include_path59

Marro tại email dot cz ¶

15 năm trước

$use_include_path60

$use_include_path61

$use_include_path8

Marro tại email dot cz ¶

Âm sắc ¶

$use_include_path63

$use_include_path64

$use_include_path65

$use_include_path66

$use_include_path8

Levhita tại Gmail Dot Com ¶

15 năm trước

$use_include_path68

$use_include_path69

$use_include_path8

Marro tại email dot cz ¶

14 năm trước

$use_include_path71