H
H
hooligan3772020-01-27 21:09:52
PHP
hooligan377, 2020-01-27 21:09:52

How to write log and read?

Greetings, the question arose about creating a site logging.

I decided to write a small php script that would collect information on the site and write it to a log file located on the server inaccessible to ordinary users.

I decided to record information using JSON strings , so that in the admin panel you could get the log in a specially designated place.

And now the most important question: I can write data to the log file as a JSON string, but how can I read it from the log file?

---
I do not accept third-party solutions, I try to interact with the code as much as possible, without resorting to a framework and ready-made solutions.
---
Thank you so much if you give me some of your time!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-01-27
@hooligan377

file_get_contents, json_decode, json_encode
I haven't written on your PHP for a long time, maybe there is something else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question