First I am trying to store the parsed info from the file separated by the comma on each line into it's own object. So from the example text below each object would have two properties [some text, here] and [other text, there]
However, before I can even do that I need to access a single line. It seems that the code I am using will only output the data read in on a single line. I am sure it's something simple I am missing. Is there a way to retrieve each line individually in PHP?
$file = new SplFileObject("/test5.txt");
while(!$file->eof())
{
echo $file->fgets()."<br/>";
}
$file = null;
source https://stackoverflow.com/questions/67826667/why-does-echoing-the-input-from-a-php-file-that-has-been-read-only-print-on-a-si
No comments:
Post a Comment