PHP function to READ RANGE OF LINES from LARGE FILE, USING GENERATORS LOW MEMORY
$10-30 USD
Đã đóng
Đã đăng vào khoảng 4 năm trước
$10-30 USD
Thanh toán khi bàn giao
Hi everyone,
I am looking for a php function ( no extra classes ) , that will read a file using generators with while feof to read specified range of lines and return them in an array.
I do not wish to get the file ( 100 mb ) into an array using file () because it will consume too much memory , I just want to navigate and get the specified range of lines , like :
getlinerange($source,$range);
$array = getlinerange('[login to view URL]','1400-2990');
Hi, I'm an experienced PHP developer. I'm familiar with using generators for accessing files to prevent memory overheads. Allow me to code a function for you that will return back the lines in the specified range from a file.
If you'd like to discuss your project with me then feel free to send me a message even when I appear offline. Expect a reply from me within a few minutes when I'm online otherwise within a few hours when I'm offline.
Thank you!
Hello,
I am PHP coder and would like to develop the script/function for you.
It will allow you only to read your specificed range of lines with the file and output an array with result.
Is it a txt file or csv?
I can start immediately with the work.
Feel free to contact me via chat.
Kind regards,
Ozzy
Hello, I can write the appropriate PHP function for your help. I can start now and finish shortly. I am very proficient in PHP and have more years of experience.
Thanks
Tahmida Rahman
I get your requirement and I am expert in dealing with files with in memory limits using generators is a great idea or we can use fgets and fgetcsv if its a csv file using these functions we will not need to load whole file.
Just need to traverse to start of range start appending array upto the end of range.