Jump to content

parse txt file


zenag

Recommended Posts

<?php
$file = file_get_contents('test.txt');

$file = explode("-----------------------------", $file);
$file = explode("\n", $file[1]);

foreach ($file as $line) {
    echo $line . "<br />";
}
?>

 

Should do the trick, explode file_get_contents and foreach

Link to comment
https://forums.phpfreaks.com/topic/144441-parse-txt-file/#findComment-758212
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.