I have a txt file, where the data is separated by |
.
I would like to read and separate content from within each pair of |
into a position of a vector. But it does not print when I put print_r
out of while
.
<?php
$arquivo = fopen ('arq.txt', 'r');
$result = array();
while(!feof($arquivo)){
$result = explode("|",fgets($arquivo));
}
fclose($arquivo);
print_r($result);
?>