MySQL Forums
Forum List  »  General

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

Hi,

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?

219
100
230



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


All helps are appreciate

Regards

Options: ReplyQuote


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


Sorry, you can't reply to this topic. It has been closed.

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.