Hi guys i m trying to view a log file as a html file from my server , i m using one script which is here , so overall i m not a coder just trying to get it work

1.
because log file latest entries are at bottom and it becomes too big after some time, so i was thinking to make something which will show last entries on top ( easy to read ) and it will show only latest 50 entries ( means last 50 entries )

2.
and i need some regular expressions to match and replace URL into link for following types

http://www.somesite.org/details.php?id=52148
[ http://www.somesite.org/details.php?id=52148 ]
(http://www.somesite.org/details.php?id=52148)

want to remove the whole line depends on word2

[word1] something-line-text [word2] some text again

-----
want to replace some text with another depends on word2

[word1] something-line-text [word2] some text again

into

REPLCACEDTEXT something-line-text some text again

thanks for help

for the first question to retrieve the data of the log file, there is a command available in linux. You can use that in your php code using any of these functions system, passthru, exec...

The command is something like

tail -f 'your_path_of_logfile'

for more details on tail check
tail --help in linux prompt

I didn't get what we have to do exactly

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.