Hướng dẫn dùng matlab fseek trong PHP
Định Nghĩa.Hàm Show
Cú pháp.Cú pháp:fseek ( resource Trong đó.
Giá trị trả về.
Ví dụ.Ví dụ # 1 Một ví dụ đơn giản về fseek()code:Ghi chú.
Hàm liên quan.
Thông tin thêm.
Các bạn có thể xem chi tiết hơn trên php.net. Hi vọng với bài viết này, bạn đã hiểu rõ ứng dụng của hàm fseek() trong PHP. Nếu bạn thấy bài viết hay và có ý nghĩa hãy like và chia sẻ bài viết này để mọi người cùng nhau học tập nhé. Cảm ơn các bạn đã ghé thăm codetutam.com fseekMove to specified position in file SyntaxDescription
Examplescollapse all Move to New Position in FileOpen the following Use fid = fopen('badpoem.txt');
ftell(fid) Read the first three lines and query the position in the file after each read. Use tline1 = fgetl(fid) % read the first line tline1 = 'Oranges and lemons,' Read the second line and examine the current position. tline2 = fgetl(fid) % read the second line tline2 = 'Pineapples and tea.' Read the third line and examine the current position. tline3 = fgetl(fid) % read the third line tline3 = 'Orangutans and monkeys,' To read line 2, set the position in the file to point to the beginning of line 2. Use fseek(fid,20,'bof');
fgetl(fid) ans = 'Pineapples and tea.' Close the file. Input Argumentscollapse all fileID — File identifier integerFile identifier of an open file, specified as an integer. Before using Data Types: offset — Number of bytes integerNumber of bytes to move from Data Types: origin — Starting location integer | character vector | stringStarting location in the file, specified as a character vector, string scalar, or a scalar number.
Data Types: Tips
AlternativesTo move to the beginning of a file, call This call is identical to Extended CapabilitiesC/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.Usage notes and limitations:
Version HistoryIntroduced before R2006a
|