$fh = fopen('test.txt', 'r') or die("can't open: $php_errormsg");
while (! feof($fh)) {
$s = rtrim(fgets($fh,5000));
list($Field....) = explode ('|', $s);
The problem I am having is that when I try to read in the file with html in one of the fields, it throws it all off. The total length of the line is about 4200 characters including the html. The length of the html is about 3000 characters. Everything works fine if I have text and html in that field, but not when I use the full html of that size.
Is there a size limit using this method? Is there another way I can parse out the fields?
Another issue, is it always adds 1 extra record on the database action ran after the above code. Any way to avoid this?
I appreciate your assistance.