MySQL Forums
Forum List  »  General

get some string from a txt file
Posted by: Alexandre Salomé
Date: February 20, 2019 09:13AM


I have a big file (*.txt) with the content:

2019-02-20 01:45:07 filtered by value: 219
2019-02-20 01:48:07 filtered by value: 100
2019-02-20 01:53:07 filtered by value: 230

How I do to display the last value of each line?


I am trying use the code bellow to print on html, but I can´t take the last string of each line
$arquivo = 'C:\BACKUP\sales_Feb.txt';
$fp = fopen($arquivo,'r');
$texto = fread($fp, filesize($arquivo));
$texto = nl2br($texto);
echo $texto;

All helps are appreciate


Options: ReplyQuote

Written By
get some string from a txt file
February 20, 2019 09:13AM

Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.