C
C
Crash2016-12-13 13:28:01
PHP
Crash, 2016-12-13 13:28:01

How to read a remote file line by line via FTP?

There are log files on the server, the connection to it goes via FTP. It is necessary to periodically parse these files and enter the results into a database table. How to read remote file line by line in PHP?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-12-13
@Bandicoot

Try the same as with a local file - fopen(' ftp://... ', '...'); further reading line by line.
Restrictions - php.net/manual/ru/wrappers.ftp.php Line
-by-line reading example - php.net/manual/ru/features.remote-files.php
Didn't check, but it should work.

M
Max, 2016-12-13
@MaxDukov

hardly line by line. But blocks - completely. via curl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question