How to get a part of text from a file in PHP
Posted on 2012-03-12
I am stumped. I am trying to use File_get_content and Fgets to get a part of text from a file.
Here is the file:
I am still very much learning and would really like to know how to get the bolded section from this text file.
I tried $sec = file_get_contents('./Inputfile.txt', NULL, NULL, '~trn*', 150); but that does not work. I also tried fgets but did not understand how I could get that to show in what I wanted.
The end results would be:
ABC.txt is the filename
ABC_~TRN*1*1058202611*.txt would be the new filename.
Please help. Thanks